@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.
@@ -15,7 +15,8 @@ const TEMPLATE_DIR = {
15
15
  evolution: "evolution",
16
16
  };
17
17
 
18
- const args = process.argv.slice(2);
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 @pinkaphant/create-kolmo@latest <project-dir> [--template ${CANONICAL_TEMPLATES.join("|")}] [--no-install|--skip-install]`,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinkaphant/create-kolmo",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Scaffold a new @pinkaphant/kolmo + @khr3/core + @khr3/roads + @khr3/c12 3D physics game in one command",
5
5
  "license": "MIT",
6
6
  "type": "module",