pleumrouter 0.5.11 → 0.5.13
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/menu.mjs +3 -1
- package/src/upgrade.mjs +3 -2
package/package.json
CHANGED
package/src/menu.mjs
CHANGED
|
@@ -142,7 +142,9 @@ async function ensureInstalled(r) {
|
|
|
142
142
|
}
|
|
143
143
|
console.log(style.dim(`$ ${r.install}`));
|
|
144
144
|
const code = await new Promise((res) => {
|
|
145
|
-
const
|
|
145
|
+
const [cmd, ...args] = r.install.trim().split(/\s+/);
|
|
146
|
+
const bin = process.platform === "win32" && (cmd === "npm" || cmd === "npx" || cmd === "yarn" || cmd === "pnpm") ? `${cmd}.cmd` : cmd;
|
|
147
|
+
const c = spawn(bin, args, { stdio: "inherit" });
|
|
146
148
|
c.on("exit", (n) => res(n ?? 1));
|
|
147
149
|
c.on("error", () => res(1));
|
|
148
150
|
});
|
package/src/upgrade.mjs
CHANGED
|
@@ -3,9 +3,10 @@ import { spawn } from "node:child_process";
|
|
|
3
3
|
// 최신 버전으로 전역 재설치. brew tap 보류 상태라 npm 경로([[project_pleum_cli]]).
|
|
4
4
|
export function upgrade() {
|
|
5
5
|
console.log("▶ npm install -g pleumrouter@latest\n");
|
|
6
|
-
const
|
|
6
|
+
const bin = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
7
|
+
const child = spawn(bin, ["install", "-g", "pleumrouter@latest"], {
|
|
7
8
|
stdio: "inherit",
|
|
8
|
-
shell:
|
|
9
|
+
shell: false,
|
|
9
10
|
});
|
|
10
11
|
child.on("error", (e) => {
|
|
11
12
|
console.error(`✗ ${e.message}`);
|