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

Commit 158b685

Browse files
committed
Added support for generator to run in current dir if user enters "."
1 parent 2c60bab commit 158b685

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

generators/app/validator.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ let projectDirectory;
99

1010
validators.storeArg = async function(props) {
1111
projectDirectory = props;
12+
if (projectDirectory.trim() === ".") {
13+
return true;
14+
}
15+
1216
var res = await executeCommand("mkdir " + projectDirectory)
1317
.then(() => true)
1418
.catch(err => {
@@ -252,14 +256,6 @@ function executeCommand(command, type) {
252256
spinner: "weather"
253257
});
254258
spinner.start();
255-
if (type === "projectDirectory") {
256-
if (command === "." || command.trim() === "") {
257-
command = "mkdir webcomponent && cd webcomponent";
258-
} else {
259-
command = "mkdir " + command + " && cd " + command;
260-
}
261-
}
262-
263259
return new Promise((resolve, reject) => {
264260
exec(command, (err, stdout) => {
265261
if (err) {

0 commit comments

Comments
 (0)