@pinkaphant/create-kolmo 0.7.0 → 0.7.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/bin/create-kolmo.mjs +7 -3
- package/package.json +1 -1
package/bin/create-kolmo.mjs
CHANGED
|
@@ -15,7 +15,8 @@ const TEMPLATE_DIR = {
|
|
|
15
15
|
evolution: "evolution",
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const rawArgs = process.argv.slice(2);
|
|
19
|
+
const args = rawArgs[0] === "create" || rawArgs[0] === "init" ? rawArgs.slice(1) : rawArgs;
|
|
19
20
|
let targetArg = "";
|
|
20
21
|
let skipInstall = false;
|
|
21
22
|
let template = "road";
|
|
@@ -24,14 +25,17 @@ for (let i = 0; i < args.length; i++) {
|
|
|
24
25
|
const a = args[i];
|
|
25
26
|
if (a === "--no-install" || a === "--skip-install") {
|
|
26
27
|
skipInstall = true;
|
|
27
|
-
} else if (a === "--template") {
|
|
28
|
+
} else if (a === "--template" || a === "-t") {
|
|
28
29
|
template = args[++i] || "";
|
|
29
30
|
} else if (a.startsWith("--template=")) {
|
|
30
31
|
template = a.slice("--template=".length);
|
|
32
|
+
} else if (a === "--list") {
|
|
33
|
+
console.log(CANONICAL_TEMPLATES.join("\n"));
|
|
34
|
+
process.exit(0);
|
|
31
35
|
} else if (a === "-h" || a === "--help") {
|
|
32
36
|
console.log(
|
|
33
37
|
`Usage: npm create @pinkaphant/kolmo@latest <project-dir> [--template ${CANONICAL_TEMPLATES.join("|")}] [--no-install|--skip-install]\n` +
|
|
34
|
-
` or: npx
|
|
38
|
+
` or: npx create-kolmo@latest <project-dir> [-t ${CANONICAL_TEMPLATES.join("|")}] [--list] [--no-install]`,
|
|
35
39
|
);
|
|
36
40
|
process.exit(0);
|
|
37
41
|
} else if (!a.startsWith("-") && !targetArg) {
|
package/package.json
CHANGED