Skip to content
This repository has been archived by the owner on Mar 26, 2018. It is now read-only.

change appPath to accept bower.json config #254

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion all/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ function Generator(args, options, config) {
this.dirs = 'models collections views routes helpers templates'.split(' ');

this.option('coffee');
this.env.options.appPath = this.options.appPath || 'app';

if (typeof this.env.options.appPath === 'undefined') {
try {
this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
} catch (e) {}
if(!this.env.options.appPath) {
this.env.options.appPath = this.options.appPath || 'app';
}
}
this.config.set('appPath', this.env.options.appPath);

args = ['application'];
Expand Down
9 changes: 8 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@ var Generator = module.exports = function Generator(args, options, config) {
this.appname = this.appname || path.basename(process.cwd());
this.appname = backboneUtils.classify(this.appname);

this.env.options.appPath = this.options.appPath || 'app';
if (typeof this.env.options.appPath === 'undefined') {
try {
this.env.options.appPath = require(path.join(process.cwd(), 'bower.json')).appPath;
} catch (e) {}
if(!this.env.options.appPath) {
this.env.options.appPath = this.options.appPath || 'app';
}
}
this.config.set('appPath', this.env.options.appPath);

this.testFramework = this.options['test-framework'] || 'mocha';
Expand Down