-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(all generators): replace custom
determineRoot()
sub-generator …
…functionality with the Yeoman default '.yo-rc.json' based one. Let the app generator create a '.yo-rc.json' config file, containing a 'version' entry ' entry, designating the generator's version. Sub-generators use the presence of this entry to assert whether they are running as part of a BAT app project. Yeoman itself will take care of locating the project root.
- Loading branch information
Showing
6 changed files
with
85 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Mix in common ground for sub-generators. | ||
// | ||
|
||
'use strict'; | ||
|
||
var chalk = require( 'chalk' ); | ||
|
||
module.exports = | ||
{ | ||
_assertBatApp: function () | ||
{ | ||
/* jshint laxbreak: true */ | ||
|
||
if ( !( this.config.get( 'generator-version' ) )) | ||
{ | ||
this.env.error( | ||
chalk.bold.red( 'I cannot find a BAT app to hook into!\n' ) | ||
+ '\n' | ||
+ 'Is your current working directory part of your project tree?\n' | ||
+ 'Does your project root have a valid "' + chalk.bold( '.yo-rc.json' ) + '" file?\n' | ||
+ 'If you have never done so before, please run "' + chalk.yellow.bold( 'yo bat' ) + '" from your project root first.\n' | ||
); | ||
} | ||
} | ||
} | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters