|
2 | 2 | // Run from the user's project; locate the release from this installed file. |
3 | 3 | import { spawnSync } from "node:child_process"; |
4 | 4 | import { existsSync, readFileSync, realpathSync } from "node:fs"; |
5 | | -import { dirname, join } from "node:path"; |
| 5 | +import { join, win32 } from "node:path"; |
6 | 6 | import { fileURLToPath, pathToFileURL } from "node:url"; |
7 | 7 |
|
8 | 8 | const root = fileURLToPath(new URL("../../../", import.meta.url)); |
@@ -46,16 +46,22 @@ export function invocation( |
46 | 46 | throw new Error( |
47 | 47 | "Update HyperFrames through your agent's plugin manager; bundled skills are release-managed.", |
48 | 48 | ); |
49 | | - const childEnv = { ...env, HYPERFRAMES_SKIP_SKILLS: "1", HYPERFRAMES_SKILL_PKG_VERSION: version }; |
| 49 | + const childEnv = { |
| 50 | + ...env, |
| 51 | + HYPERFRAMES_SKIP_SKILLS: "1", |
| 52 | + HYPERFRAMES_SKILL_PKG_VERSION: version, |
| 53 | + HYPERFRAMES_PLUGIN_VERSION: version, |
| 54 | + HYPERFRAMES_NO_UPDATE_CHECK: "1", |
| 55 | + }; |
50 | 56 | if (args[0] === "--script") { |
51 | | - if (!args[1]) throw new Error("--script requires the path of a bundled Node script."); |
| 57 | + if (!args[1]) throw new Error("--script requires a Node script path."); |
52 | 58 | return { command: node, args: args.slice(1), env: childEnv }; |
53 | 59 | } |
54 | 60 | const cliArgs = ["--yes", `hyperframes@${version}`, ...args]; |
55 | 61 | if (platform !== "win32") return { command: "npx", args: cliArgs, env: childEnv }; |
56 | 62 | const candidates = [ |
57 | | - env.npm_execpath && join(dirname(env.npm_execpath), "npx-cli.js"), |
58 | | - join(dirname(node), "node_modules", "npm", "bin", "npx-cli.js"), |
| 63 | + env.npm_execpath && win32.join(win32.dirname(env.npm_execpath), "npx-cli.js"), |
| 64 | + win32.join(win32.dirname(node), "node_modules", "npm", "bin", "npx-cli.js"), |
59 | 65 | ].filter(Boolean); |
60 | 66 | const npx = candidates.find(pathExists); |
61 | 67 | if (!npx) |
|
0 commit comments