create-puzzmo 1.0.7 → 1.0.8
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/index.js +4 -8
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { spawnSync } from "node:child_process"
|
|
4
4
|
|
|
5
5
|
// Forward all args to `puzzmo game create`
|
|
6
6
|
const args = process.argv.slice(2)
|
|
@@ -8,13 +8,9 @@ const args = process.argv.slice(2)
|
|
|
8
8
|
// Detect the package manager that invoked this script
|
|
9
9
|
const pm = detectPackageManager()
|
|
10
10
|
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} catch {
|
|
15
|
-
console.log("Installing @puzzmo/cli...")
|
|
16
|
-
spawnSync("npm", ["install", "-g", "@puzzmo/cli"], { stdio: "inherit" })
|
|
17
|
-
}
|
|
11
|
+
// Always ensure the latest puzzmo CLI is installed
|
|
12
|
+
console.log("Installing @puzzmo/cli@latest...")
|
|
13
|
+
spawnSync("npm", ["install", "-g", "@puzzmo/cli@latest"], { stdio: "inherit" })
|
|
18
14
|
|
|
19
15
|
// Pass --pm so the CLI knows which package manager to use in generated files
|
|
20
16
|
const extraArgs = args.includes("--pm") ? [] : ["--pm", pm]
|