codebuff-cli 1.0.20 → 1.0.21
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.
|
@@ -224,12 +224,13 @@ async function main() {
|
|
|
224
224
|
const platform = getPlatform();
|
|
225
225
|
const binaryPath = getBinaryPath();
|
|
226
226
|
|
|
227
|
-
const
|
|
227
|
+
const baseUrl = 'https://github.com/' + REPO + '/releases/download/' + latestTag;
|
|
228
|
+
const platformUrl = baseUrl + '/codebuff-' + platform;
|
|
229
|
+
const genericUrl = baseUrl + '/codebuff';
|
|
228
230
|
|
|
229
231
|
console.log('Platform: ' + platform);
|
|
230
232
|
console.log('Version: ' + latestTag);
|
|
231
233
|
console.log('Binary path: ' + binaryPath);
|
|
232
|
-
console.log('Download URL: ' + url);
|
|
233
234
|
|
|
234
235
|
fs.mkdirSync(path.dirname(binaryPath), { recursive: true });
|
|
235
236
|
|
|
@@ -238,7 +239,21 @@ async function main() {
|
|
|
238
239
|
process.exit(0);
|
|
239
240
|
}
|
|
240
241
|
|
|
241
|
-
|
|
242
|
+
let downloaded = false;
|
|
243
|
+
|
|
244
|
+
console.log('Trying platform-specific URL: ' + platformUrl);
|
|
245
|
+
if (await downloadWithRetry(platformUrl, binaryPath)) {
|
|
246
|
+
console.log('Downloaded platform-specific binary.');
|
|
247
|
+
downloaded = true;
|
|
248
|
+
} else {
|
|
249
|
+
console.log('Platform-specific binary not found. Trying generic URL: ' + genericUrl);
|
|
250
|
+
if (await downloadWithRetry(genericUrl, binaryPath)) {
|
|
251
|
+
console.log('Downloaded generic binary.');
|
|
252
|
+
downloaded = true;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if (downloaded) {
|
|
242
257
|
console.log('Download complete.');
|
|
243
258
|
const versionFile = path.join(path.dirname(binaryPath), '.version');
|
|
244
259
|
try {
|
|
@@ -250,7 +265,8 @@ async function main() {
|
|
|
250
265
|
} else {
|
|
251
266
|
console.error('\nUnable to download the codebuff binary.');
|
|
252
267
|
console.error('You can try installing manually from:');
|
|
253
|
-
console.error(' ' +
|
|
268
|
+
console.error(' ' + platformUrl);
|
|
269
|
+
console.error(' ' + genericUrl);
|
|
254
270
|
process.exit(1);
|
|
255
271
|
}
|
|
256
272
|
|