Skip to content

Commit 1fcf261

Browse files
Sync packages from monorepo (98ee1cc)
1 parent d21202d commit 1fcf261

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

packages/create-puzzmo/src/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ const args = process.argv.slice(2)
88
// Detect the package manager that invoked this script
99
const pm = detectPackageManager()
1010

11-
// Fetch the actual latest version from the registry to avoid npm cache staleness
11+
// Resolve the actual latest version from the registry to avoid npm cache staleness
1212
const version = await fetchLatestVersion("@puzzmo/cli")
13-
console.log(`Installing @puzzmo/cli@${version}...`)
14-
spawnSync("npm", ["install", "-g", `@puzzmo/cli@${version}`], { stdio: "inherit" })
13+
console.log(`Running @puzzmo/cli@${version}...`)
1514

1615
// Pass --pm so the CLI knows which package manager to use in generated files
1716
const extraArgs = args.includes("--pm") ? [] : ["--pm", pm]
1817

19-
const result = spawnSync("puzzmo", ["game", "create", ...args, ...extraArgs], {
18+
// Use npx with the exact version to avoid stale global installs
19+
const result = spawnSync("npx", [`@puzzmo/cli@${version}`, "game", "create", ...args, ...extraArgs], {
2020
stdio: "inherit",
2121
env: process.env,
2222
})

0 commit comments

Comments
 (0)