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

Commit 9602f42

Browse files
Merge branch 'master' into update_documentation_for_new_features
2 parents 70d7a64 + e4df4d1 commit 9602f42

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

generators/app/index.js

Lines changed: 13 additions & 10 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() {
@@ -58,7 +62,7 @@ module.exports = class extends Generator {
5862
message:
5963
"I need the build file (generally index.js, main.js or componentName.js) for this, import it using one of the options -",
6064
choices: [
61-
"Install component from npm package (Recommended - fastest way)",
65+
"Install component from npm package. (Recommended - fastest way)",
6266
"Tell us the path of the build file on your local machine and I will import it in the project.",
6367
"Tell us the npm package name, version, build file URL and I will download the build file."
6468
],
@@ -83,7 +87,7 @@ module.exports = class extends Generator {
8387
name: "changeImportSourceFromNpmPackage",
8488
message: "What do you want to do?",
8589
choices: [
86-
"Enter package name again to install component from npm package.",
90+
"Enter package name again to install component from npm package. (Recommended - fastest way)",
8791
"Import the file locally from your computer.",
8892
"Enter package name, version, build file URL to download the build file."
8993
],
@@ -130,7 +134,7 @@ module.exports = class extends Generator {
130134
name: "changeImportSourceFromNpmBuildFile",
131135
message: "What do you want to do?",
132136
choices: [
133-
"Enter package name again to install component from npm package.",
137+
"Enter package name again to install component from npm package. (Recommended - fastest way)",
134138
"Import the file locally from your computer.",
135139
"Enter package name, version, build file URL to download the build file."
136140
],
@@ -203,9 +207,8 @@ module.exports = class extends Generator {
203207
{
204208
type: "input",
205209
name: "directoryName",
206-
message: `The build file will be imported in a separate directory in the project's root. Enter the name of this directory or press Enter if you like to go with default ${chalk.cyan(
207-
"component-dist"
208-
)}.`,
210+
message:
211+
"The build file will be imported in a separate directory in the project's root. Enter the name of this directory or press Enter if you like to go with default.",
209212
validate: validators.directoryName,
210213
default: "component-dist"
211214
},

generators/app/validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ validators.checkVersionAndInstallComponent = async function(props, answers) {
140140

141141
validators.directoryName = async props => {
142142
var res;
143-
if (props.trim() === "o") {
143+
if (props.trim() === "o" || props.trim() === "O") {
144144
res = await executeCommand(`rm -rf ${projectDirectory}/${buildDirectory}/*`)
145145
.then(() => true)
146146
.catch(err => {

0 commit comments

Comments
 (0)