Skip to content
This repository was archived by the owner on Mar 30, 2021. It is now read-only.

Commit 7c0530b

Browse files
committed
Minor improvements
- Improves code by using yeoman "default" argument while running generator with args (removes manually checking if user ran the generator with argument or not) - Add description for argument so that yeoman can help user if needed
1 parent 3828df3 commit 7c0530b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

generators/app/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ module.exports = class extends Generator {
88
// Note: arguments and options should be defined in the constructor.
99
constructor(args, opts) {
1010
super(args, opts);
11-
this.argument("projectDirectory", { type: String, required: false });
12-
if (!this.options.projectDirectory) {
13-
this.options.projectDirectory = "web-component";
14-
}
11+
this.argument("projectDirectory", {
12+
type: String,
13+
required: false,
14+
default: "web-component",
15+
desc: `${chalk.blue(
16+
"path of the project directory, if you enter the path of a directory which does not exist, the generator will make one for you, otherwise it will use the existing one."
17+
)} Default directory: ${chalk.cyan("web-component")}`
18+
});
1519
}
1620

1721
initializing() {

0 commit comments

Comments
 (0)