@cc-claw/peri 0.1.5 → 0.1.7
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/README.md +5 -1
- package/bin/peri +1 -1
- package/install.js +14 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/bin/peri
CHANGED
package/install.js
CHANGED
|
@@ -83,12 +83,22 @@ async function main() {
|
|
|
83
83
|
extractZip(buffer, binDir);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// Rename binary
|
|
87
|
-
const
|
|
88
|
-
const
|
|
86
|
+
// Rename extracted binary to a fixed name so bin/peri wrapper can find it
|
|
87
|
+
const { renameSync, unlinkSync } = require("fs");
|
|
88
|
+
const extractedName = platform.os === "win32"
|
|
89
|
+
? `peri-${platform.suffix}.exe`
|
|
90
|
+
: `peri-${platform.suffix}`;
|
|
91
|
+
const finalName = platform.os === "win32" ? "peri.exe" : "peri-bin";
|
|
92
|
+
const extractedPath = join(binDir, extractedName);
|
|
93
|
+
const finalPath = join(binDir, finalName);
|
|
94
|
+
|
|
95
|
+
if (existsSync(extractedPath)) {
|
|
96
|
+
if (existsSync(finalPath)) unlinkSync(finalPath);
|
|
97
|
+
renameSync(extractedPath, finalPath);
|
|
98
|
+
}
|
|
89
99
|
|
|
90
100
|
if (platform.os !== "win32") {
|
|
91
|
-
chmodSync(
|
|
101
|
+
chmodSync(finalPath, 0o755);
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
console.log(`peri ${VERSION} installed successfully.`);
|