create-prodkit 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +19 -7
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -20,16 +20,28 @@ export async function run() {
|
|
|
20
20
|
console.log(pc.bold(pc.cyan(" >> create-prodkit")));
|
|
21
21
|
console.log(pc.dim(" A production-ready project scaffold\n"));
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
try {
|
|
24
|
+
const options = await getProjectOptions(projectName);
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
26
|
+
if (!options.confirmed) {
|
|
27
|
+
console.log(pc.dim("\n Cancelled.\n"));
|
|
28
|
+
process.exit(0);
|
|
29
|
+
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
await createProject(options);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (err.name === "ExitPromptError") {
|
|
34
|
+
console.log(pc.dim("\n\n Cancelled.\n"));
|
|
35
|
+
process.exit(0);
|
|
36
|
+
}
|
|
37
|
+
throw err;
|
|
38
|
+
}
|
|
32
39
|
});
|
|
33
40
|
|
|
41
|
+
process.on("SIGINT", () => {
|
|
42
|
+
console.log(pc.dim("\n\n Cancelled.\n"));
|
|
43
|
+
process.exit(0);
|
|
44
|
+
});
|
|
45
|
+
|
|
34
46
|
program.parse();
|
|
35
47
|
}
|