Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

fix: update shim on Linux/Mac after ix upgrade

Joseph Mikhail97df62016139
diff --git a/ix-cli/src/cli/commands/upgrade.ts b/ix-cli/src/cli/commands/upgrade.ts
index 0b6ad72f..df78ee08 100644
--- a/ix-cli/src/cli/commands/upgrade.ts
+++ b/ix-cli/src/cli/commands/upgrade.ts
@@ -201,7 +201,7 @@ export function registerUpgradeCommand(program: Command): void {
process.exit(1);
}
- // On Windows, update the shim to point to the new versioned directory
+ // Update the shim to point to the newly installed binary
if (isWindows) {
const shimPath = join(homedir(), ".local", "bin", "ix");
const jsPathWin = join(installDir, `ix-${latest}-${platform}`, "cli", "dist", "cli", "main.js");
@@ -212,6 +212,19 @@ export function registerUpgradeCommand(program: Command): void {
if (existsSync(shimPath)) {
writeFileSync(shimPath, `#!/usr/bin/env bash\nexec node "${jsPath}" "$@"\n`);
}
+ } else {
+ const binaryPath = join(installDir, "ix");
+ const shimLocations = [
+ join(homedir(), ".local", "bin", "ix"),
+ "/usr/local/bin/ix",
+ ];
+ for (const shimPath of shimLocations) {
+ if (existsSync(shimPath)) {
+ writeFileSync(shimPath, `#!/usr/bin/env bash\nexec "${binaryPath}" "$@"\n`);
+ try { execFileSync("chmod", ["+x", shimPath], { stdio: "ignore" }); } catch { /* ignore */ }
+ break;
+ }
+ }
}
console.log(`[ok] Upgraded ix: ${current} → ${latest}`);