codeforge-cli 0.1.0 → 0.1.1
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/bin/forge +11 -40
- package/package.json +1 -1
- package/scripts/postinstall.js +2 -3
package/bin/forge
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
#!/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const libDir = path.join(__dirname, '..', 'lib');
|
|
13
|
-
const ext = os.platform() === 'win32' ? '.exe' : '';
|
|
14
|
-
const forgeBinary = path.join(libDir, `forge${ext}`);
|
|
15
|
-
|
|
16
|
-
// Check if binary exists
|
|
17
|
-
const fs = require('fs');
|
|
18
|
-
if (!fs.existsSync(forgeBinary)) {
|
|
19
|
-
console.error('\x1b[31m[forge]\x1b[0m Binary not found. Try reinstalling:');
|
|
20
|
-
console.error(' npm uninstall -g forge-cli && npm install -g forge-cli');
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Spawn the binary with inherited stdio
|
|
25
|
-
const child = spawn(forgeBinary, process.argv.slice(2), {
|
|
26
|
-
stdio: 'inherit',
|
|
27
|
-
env: {
|
|
28
|
-
...process.env,
|
|
29
|
-
FORGE_LIB_DIR: libDir
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
child.on('error', (err) => {
|
|
34
|
-
console.error(`\x1b[31m[forge]\x1b[0m Failed to start: ${err.message}`);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
child.on('exit', (code) => {
|
|
39
|
-
process.exit(code || 0);
|
|
40
|
-
});
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Forge CLI wrapper - launches the actual binary from lib/
|
|
3
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
4
|
+
LIB_DIR="$SCRIPT_DIR/../lib"
|
|
5
|
+
|
|
6
|
+
if [ -x "$LIB_DIR/forge" ]; then
|
|
7
|
+
exec "$LIB_DIR/forge" "$@"
|
|
8
|
+
else
|
|
9
|
+
echo "Error: Forge binary not found. Please reinstall: npm install -g codeforge-cli"
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -11,9 +11,8 @@ const path = require('path');
|
|
|
11
11
|
const https = require('https');
|
|
12
12
|
const { execSync } = require('child_process');
|
|
13
13
|
|
|
14
|
-
// Configuration - Use
|
|
15
|
-
const
|
|
16
|
-
const DOWNLOAD_BASE = process.env.FORGE_DOWNLOAD_URL || `https://github.com/${GITHUB_REPO}/releases/download`;
|
|
14
|
+
// Configuration - Use Cloudflare R2 as CDN
|
|
15
|
+
const DOWNLOAD_BASE = process.env.FORGE_DOWNLOAD_URL || 'https://pub-63b4afd13ea24e6f94f86d0b7f3a802c.r2.dev/forge-cli';
|
|
17
16
|
const VERSION = require('../package.json').version;
|
|
18
17
|
const BIN_DIR = path.join(__dirname, '..', 'bin');
|
|
19
18
|
const LIB_DIR = path.join(__dirname, '..', 'lib');
|