Skip to content

Commit 053642e

Browse files
authored
Merge pull request #339 from kethinov/app-name-via-cli
0.19.3
2 parents cae0be6 + 01f1754 commit 053642e

File tree

4 files changed

+416
-316
lines changed

4 files changed

+416
-316
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
- Put your changes here...
66

7+
## 0.19.3
8+
9+
- Fixed custom app name supplied via CLI.
10+
- Various dependencies bumped.
11+
712
## 0.19.2
813

914
- Fixed missing favicon from generated app.

generators/app/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ const helper = require('./promptingHelpers')
33
const defaults = require('./templates/defaults.json')
44
const beautify = require('gulp-beautify')
55
const filter = require('gulp-filter')
6+
const cache = {}
67

78
module.exports = class extends Generator {
89
constructor (args, opts) {
910
super(args, opts)
1011

12+
// if this is executed like `yo roosevelt --standard-install custom-app-name`, cache that name so it can override appName later
13+
if (opts.standardInstall && typeof opts.standardInstall === 'string') {
14+
cache.standardInstall = opts.standardInstall
15+
}
16+
1117
this.option('standard-install', {
1218
alias: 's',
1319
type: String,
@@ -34,6 +40,9 @@ module.exports = class extends Generator {
3440
start () {
3541
if (this.options['standard-install']) {
3642
this.appName = defaults.appName
43+
if (cache.standardInstall) {
44+
this.appName = cache.standardInstall
45+
}
3746
this.packageName = helper.sanitizePackageName(this.appName)
3847
return true
3948
}

0 commit comments

Comments
 (0)