@_xtribe/cli 1.0.50 → 1.0.51
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-tribe-autolaunch.js +5 -2
- package/install-tribe.js +51 -9
- package/package.json +1 -1
|
@@ -231,8 +231,11 @@ async function handleAutoLaunch() {
|
|
|
231
231
|
await sleep(1000);
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
// Check and start cluster if needed
|
|
235
|
-
|
|
234
|
+
// Check and start cluster if needed (skip if --no-start was used)
|
|
235
|
+
const args = process.argv.slice(2);
|
|
236
|
+
const skipCluster = args.includes('--skip-cluster') || args.includes('--no-start');
|
|
237
|
+
|
|
238
|
+
if (!skipCluster && !await isClusterRunning()) {
|
|
236
239
|
const started = await startCluster();
|
|
237
240
|
if (!started) {
|
|
238
241
|
showManualInstructions();
|
package/install-tribe.js
CHANGED
|
@@ -639,8 +639,18 @@ async function installTribeCLI() {
|
|
|
639
639
|
// Multiple sources for reliability
|
|
640
640
|
// For testing, use a direct URL to our releases folder
|
|
641
641
|
const isTestEnv = process.env.TRIBE_TEST_BINARY_URL;
|
|
642
|
+
const testBinary = process.env.TRIBE_TEST_BINARY;
|
|
642
643
|
const githubRepo = process.env.TRIBE_INSTALLER_REPO || 'TRIBE-INC/0zen';
|
|
643
644
|
|
|
645
|
+
// If we have a test binary file, use it directly
|
|
646
|
+
if (testBinary && fs.existsSync(testBinary)) {
|
|
647
|
+
spinner.text = 'Using test binary...';
|
|
648
|
+
fs.copyFileSync(testBinary, tribeDest);
|
|
649
|
+
fs.chmodSync(tribeDest, '755');
|
|
650
|
+
spinner.succeed('✓ TRIBE CLI installed from test binary');
|
|
651
|
+
return true;
|
|
652
|
+
}
|
|
653
|
+
|
|
644
654
|
let downloadUrl = '';
|
|
645
655
|
|
|
646
656
|
try {
|
|
@@ -659,17 +669,28 @@ async function installTribeCLI() {
|
|
|
659
669
|
if (!releases || releases.length === 0) {
|
|
660
670
|
throw new Error('No releases found');
|
|
661
671
|
}
|
|
662
|
-
|
|
663
|
-
|
|
672
|
+
|
|
673
|
+
// Find a release with the binary we need
|
|
674
|
+
let foundRelease = null;
|
|
664
675
|
const assetName = `tribe-${platform}-${arch}`;
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
676
|
+
|
|
677
|
+
for (const release of releases) {
|
|
678
|
+
if (release.draft) continue;
|
|
679
|
+
const asset = release.assets?.find(a => a.name === assetName || a.name === `${assetName}.exe`);
|
|
680
|
+
if (asset) {
|
|
681
|
+
foundRelease = release;
|
|
682
|
+
downloadUrl = asset.browser_download_url;
|
|
683
|
+
spinner.text = `Found binary in release: ${release.tag_name}`;
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if (!foundRelease) {
|
|
689
|
+
// No release has the binary, try constructing URL from latest release
|
|
690
|
+
const latestRelease = releases[0];
|
|
691
|
+
downloadUrl = `https://github.com/${githubRepo}/releases/download/${latestRelease.tag_name}/tribe-${platform}-${arch}`;
|
|
692
|
+
spinner.text = `Trying release: ${latestRelease.tag_name}`;
|
|
669
693
|
}
|
|
670
|
-
|
|
671
|
-
downloadUrl = asset.browser_download_url;
|
|
672
|
-
spinner.text = `Found latest release: ${latestRelease.tag_name}`;
|
|
673
694
|
} catch (error) {
|
|
674
695
|
log.warning(`Failed to get release info: ${error.message}`);
|
|
675
696
|
// Try to get the latest release tag directly
|
|
@@ -1549,6 +1570,17 @@ async function forceCleanInstallation() {
|
|
|
1549
1570
|
log.info('npm cache clean attempted (may have failed, which is okay)');
|
|
1550
1571
|
}
|
|
1551
1572
|
|
|
1573
|
+
// Remove first-install marker to allow auto-launch
|
|
1574
|
+
const firstInstallMarker = path.join(tribeDir, '.first-install-complete');
|
|
1575
|
+
if (fs.existsSync(firstInstallMarker)) {
|
|
1576
|
+
try {
|
|
1577
|
+
fs.unlinkSync(firstInstallMarker);
|
|
1578
|
+
log.success('Removed first-install marker');
|
|
1579
|
+
} catch (error) {
|
|
1580
|
+
log.warning(`Could not remove first-install marker: ${error.message}`);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1552
1584
|
// Platform-specific cleanup
|
|
1553
1585
|
if (platform === 'darwin') {
|
|
1554
1586
|
// Check if Colima is running and stop it
|
|
@@ -1704,6 +1736,16 @@ async function main() {
|
|
|
1704
1736
|
// Verify everything first
|
|
1705
1737
|
const verified = await verifyInstallation();
|
|
1706
1738
|
|
|
1739
|
+
// If critical components failed (especially TRIBE CLI), exit with error
|
|
1740
|
+
if (!allSuccess) {
|
|
1741
|
+
// Check specifically if TRIBE CLI installation failed
|
|
1742
|
+
const tribeBinaryExists = fs.existsSync(path.join(tribeBinDir, 'tribe'));
|
|
1743
|
+
if (!tribeBinaryExists) {
|
|
1744
|
+
console.error(chalk.red('\n❌ Installation failed: TRIBE CLI could not be installed'));
|
|
1745
|
+
process.exit(1);
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1707
1749
|
// Try to start container runtime (after showing results)
|
|
1708
1750
|
const runtimeStarted = await startContainerRuntime();
|
|
1709
1751
|
|