@agi-cli/install 0.1.40 → 0.1.42
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/start.js +10 -11
package/package.json
CHANGED
package/start.js
CHANGED
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
statSync,
|
|
9
9
|
readFileSync,
|
|
10
10
|
appendFileSync,
|
|
11
|
-
} from 'fs';
|
|
12
|
-
import { resolve, dirname } from 'path';
|
|
13
|
-
import { fileURLToPath } from 'url';
|
|
14
|
-
import { get } from 'https';
|
|
15
|
-
import { homedir, platform, arch } from 'os';
|
|
16
|
-
import { spawnSync, spawn } from 'child_process';
|
|
11
|
+
} from 'node:fs';
|
|
12
|
+
import { resolve, dirname } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import { get } from 'node:https';
|
|
15
|
+
import { homedir, platform, arch } from 'node:os';
|
|
16
|
+
import { spawnSync, spawn } from 'node:child_process';
|
|
17
17
|
|
|
18
18
|
const REPO = 'nitishxyz/agi';
|
|
19
19
|
const BIN_NAME = 'agi';
|
|
@@ -43,7 +43,7 @@ function findBinaryInPath() {
|
|
|
43
43
|
return binPath;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
} catch (
|
|
46
|
+
} catch (_err) {}
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
return null;
|
|
@@ -57,7 +57,7 @@ function getVersion(binaryPath) {
|
|
|
57
57
|
const match = result.stdout.trim().match(/[\d.]+/);
|
|
58
58
|
return match ? match[0] : null;
|
|
59
59
|
}
|
|
60
|
-
} catch (
|
|
60
|
+
} catch (_err) {
|
|
61
61
|
// If we can't get version, return null
|
|
62
62
|
}
|
|
63
63
|
return null;
|
|
@@ -203,7 +203,7 @@ function updateShellProfile(userBin) {
|
|
|
203
203
|
appendFileSync(configFile, `\n${pathExport}\n`);
|
|
204
204
|
console.log(`✓ Added ${userBin} to PATH in ${configFile}`);
|
|
205
205
|
console.log(`✓ Restart your ${shellType} or run: source ${configFile}`);
|
|
206
|
-
} catch (
|
|
206
|
+
} catch (_error) {
|
|
207
207
|
// Silently fail if we can't update the profile
|
|
208
208
|
console.log(`⚠️ Could not automatically update ${configFile}`);
|
|
209
209
|
}
|
|
@@ -310,8 +310,7 @@ async function main() {
|
|
|
310
310
|
|
|
311
311
|
if (binaryPath) {
|
|
312
312
|
// Binary exists, check version
|
|
313
|
-
const {
|
|
314
|
-
await checkAndUpdateVersion(binaryPath);
|
|
313
|
+
const { binaryPath: updatedPath } = await checkAndUpdateVersion(binaryPath);
|
|
315
314
|
binaryPath = updatedPath;
|
|
316
315
|
|
|
317
316
|
const child = spawn(binaryPath, process.argv.slice(2), {
|