@agentfare/forge 0.2.3 → 0.2.4
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/install.js +11 -2
- package/package.json +1 -1
package/install.js
CHANGED
|
@@ -57,7 +57,12 @@ async function main() {
|
|
|
57
57
|
|
|
58
58
|
const { goos, goarch } = getPlatform();
|
|
59
59
|
const archiveName = `forge_${VERSION}_${goos}_${goarch}.tar.gz`;
|
|
60
|
-
|
|
60
|
+
|
|
61
|
+
// Support custom binary host for regions with poor GitHub connectivity.
|
|
62
|
+
// Usage: FORGE_BINARY_HOST=https://mirror.example.com npm install -g @agentfare/forge
|
|
63
|
+
const baseUrl = process.env.FORGE_BINARY_HOST
|
|
64
|
+
|| "https://github.com/MjxUpUp/forge/releases/download";
|
|
65
|
+
const url = `${baseUrl}/v${VERSION}/${archiveName}`;
|
|
61
66
|
|
|
62
67
|
const archivePath = path.join(binDir, archiveName);
|
|
63
68
|
console.log(`Downloading forge v${VERSION} for ${goos}/${goarch}...`);
|
|
@@ -84,6 +89,10 @@ async function main() {
|
|
|
84
89
|
|
|
85
90
|
main().catch((err) => {
|
|
86
91
|
console.error("Installation failed:", err.message);
|
|
87
|
-
console.error("
|
|
92
|
+
console.error("");
|
|
93
|
+
console.error("If GitHub is unreachable, set a mirror:");
|
|
94
|
+
console.error(" FORGE_BINARY_HOST=https://your-mirror.com npm install -g @agentfare/forge");
|
|
95
|
+
console.error("");
|
|
96
|
+
console.error("Or download manually: https://github.com/MjxUpUp/forge/releases");
|
|
88
97
|
process.exit(1);
|
|
89
98
|
});
|