executor 1.4.5 → 1.4.6
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/postinstall.cjs +9 -4
package/package.json
CHANGED
package/postinstall.cjs
CHANGED
|
@@ -22,7 +22,7 @@ const platform = platformMap[os.platform()] || os.platform();
|
|
|
22
22
|
const arch = os.arch() === "arm64" ? "arm64" : "x64";
|
|
23
23
|
const binary = platform === "windows" ? "executor.exe" : "executor";
|
|
24
24
|
const cachedBinary = path.join(runtimeDir, binary);
|
|
25
|
-
const legacyCachedBinary = path.join(binDir, platform === "
|
|
25
|
+
const legacyCachedBinary = path.join(binDir, platform === "windows" ? ".executor.exe" : ".executor");
|
|
26
26
|
|
|
27
27
|
const isMusl = (() => {
|
|
28
28
|
if (platform !== "linux") return false;
|
|
@@ -75,11 +75,16 @@ const extract = () => {
|
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const psCommand = [
|
|
79
79
|
"$ErrorActionPreference = 'Stop'",
|
|
80
80
|
"Expand-Archive -LiteralPath '" + archivePath.replace(/'/g, "''") + "' -DestinationPath '" + runtimeDir.replace(/'/g, "''") + "' -Force",
|
|
81
81
|
].join("; ");
|
|
82
|
-
|
|
82
|
+
const psArgs = ["-NoLogo", "-NoProfile", "-Command", psCommand];
|
|
83
|
+
// Prefer pwsh (PowerShell 7+) which reliably has Expand-Archive; fall back to powershell.exe
|
|
84
|
+
const pwshResult = childProcess.spawnSync("pwsh", psArgs, { stdio: "inherit" });
|
|
85
|
+
if (pwshResult.error || (typeof pwshResult.status === "number" && pwshResult.status !== 0)) {
|
|
86
|
+
run("powershell.exe", psArgs);
|
|
87
|
+
}
|
|
83
88
|
};
|
|
84
89
|
|
|
85
90
|
(async () => {
|
|
@@ -94,7 +99,7 @@ const extract = () => {
|
|
|
94
99
|
if (fs.existsSync(legacyCachedBinary)) {
|
|
95
100
|
fs.unlinkSync(legacyCachedBinary);
|
|
96
101
|
}
|
|
97
|
-
fs.chmodSync(cachedBinary, 0o755);
|
|
102
|
+
if (platform !== "windows") fs.chmodSync(cachedBinary, 0o755);
|
|
98
103
|
fs.rmSync(archivePath, { force: true });
|
|
99
104
|
console.log("executor: installed " + assetBase + " from GitHub Releases");
|
|
100
105
|
} catch (error) {
|