Skip to content

Commit 910a937

Browse files
committed
Fix generator option parser boolean issue
1 parent 6a494f3 commit 910a937

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

generators/app/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ module.exports = class extends Generator {
5757
default: true
5858
} */ ]).then(answers => {
5959
this.args = answers;
60+
this.args.isPageObject = this.convert_yes_no_to_boolean(answers.isPageObject);
61+
this.args.isAtdd = this.convert_yes_no_to_boolean(answers.isAtdd);
6062
this.config.set(this.args);
6163
});
6264
}
@@ -167,4 +169,15 @@ module.exports = class extends Generator {
167169
this.config.save();
168170
}
169171

172+
convert_yes_no_to_boolean(option) {
173+
if (option == undefined) {
174+
return false;
175+
}
176+
if (option.toLowerCase() == 'yes') {
177+
return true;
178+
}
179+
return false;
180+
}
181+
182+
170183
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-robotframework",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"description": "Yeoman generator to create a robotframework test project",
55
"files": [
66
"generators"

0 commit comments

Comments
 (0)