@cc-claw/peri 0.1.6 → 0.1.8

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.
Files changed (3) hide show
  1. package/bin/peri +1 -1
  2. package/install.js +18 -4
  3. package/package.json +1 -1
package/bin/peri CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/bin/sh
2
- dir="$(dirname "$0")"
2
+ dir="$(dirname "$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || echo "$0")")"
3
3
  exec "${dir}/peri-bin" "$@"
package/install.js CHANGED
@@ -83,12 +83,26 @@ async function main() {
83
83
  extractZip(buffer, binDir);
84
84
  }
85
85
 
86
- // Rename binary and set permissions
87
- const binaryName = platform.os === "win32" ? "peri.exe" : "peri-bin";
88
- const binaryPath = join(binDir, binaryName);
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(binaryPath, 0o755);
101
+ const { chmodSync: chmod } = require("fs");
102
+ chmod(finalPath, 0o755);
103
+ // Ensure the shell wrapper is also executable
104
+ const wrapperPath = join(__dirname, "bin", "peri");
105
+ if (existsSync(wrapperPath)) chmod(wrapperPath, 0o755);
92
106
  }
93
107
 
94
108
  console.log(`peri ${VERSION} installed successfully.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-claw/peri",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Terminal coding agent powered by open-source models — Rust-built, Claude Code compatible",
5
5
  "keywords": [
6
6
  "agent",