Skip to content

Commit b25ba13

Browse files
author
Peter Ullrich
committed
trySubscribeSharedOption
1 parent 30fd84e commit b25ba13

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.2.5",
2+
"version": "0.3.0",
33
"name": "dotup-typescript-yeoman-generators",
44
"author": {
55
"name": "Peter Ullrich",

src/BaseGenerator.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ export abstract class BaseGenerator<TStep extends string> extends generator impl
6262
this.composeWith(require.resolve('generator'), optArgs);
6363
}
6464

65-
subscribeSharedOption(questionName: TStep | string): void {
66-
this.sharedOptions.subscribe(this, questionName);
65+
trySubscribeSharedOption(questionName: TStep | string): void {
66+
if (this.sharedOptions !== undefined) {
67+
this.sharedOptions.subscribe(this, questionName);
68+
}
6769
}
6870

6971
addSkipEjsReplacement(targetPath: string): void {

0 commit comments

Comments
 (0)