Yeoman generator support for optional --projectguid=... CLI argument

This commit is contained in:
SteveSandersonMS
2016-09-13 13:57:23 +01:00
parent 7f841ff840
commit b72435c5cc
2 changed files with 3 additions and 2 deletions

View File

@@ -28,6 +28,7 @@ class MyGenerator extends yeoman.Base {
prompting() {
const done = this.async();
this.option('projectguid');
this._optionOrPrompt([{
type: 'list',
name: 'framework',
@@ -41,7 +42,7 @@ class MyGenerator extends yeoman.Base {
}], answers => {
this._answers = answers;
this._answers.namePascalCase = toPascalCase(answers.name);
this._answers.projectGuid = uuid.v4();
this._answers.projectGuid = this.options['projectguid'] || uuid.v4();
done();
});
}