@_xtribe/cli 2.1.8 ā 2.2.0
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.js +38 -8
- package/package.json +1 -1
- package/tribe.js +14 -17
package/install-tribe.js
CHANGED
|
@@ -24,14 +24,29 @@ const arch = os.arch() === 'x64' ? 'amd64' : (os.arch() === 'arm64' ? 'arm64' :
|
|
|
24
24
|
const homeDir = os.homedir();
|
|
25
25
|
const tribeDir = path.join(homeDir, '.tribe');
|
|
26
26
|
const tribeBinDir = path.join(tribeDir, 'bin');
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
27
|
+
const tutorDir = path.join(tribeDir, 'tutor');
|
|
28
|
+
const logsDir = path.join(tribeDir, 'logs');
|
|
29
|
+
|
|
30
|
+
// Ensure all directories exist with proper permissions (700)
|
|
31
|
+
const directories = [
|
|
32
|
+
{ path: tribeDir, name: 'base' },
|
|
33
|
+
{ path: tribeBinDir, name: 'bin' },
|
|
34
|
+
{ path: tutorDir, name: 'tutor' },
|
|
35
|
+
{ path: logsDir, name: 'logs' }
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
directories.forEach(({ path: dirPath, name }) => {
|
|
39
|
+
if (!fs.existsSync(dirPath)) {
|
|
40
|
+
fs.mkdirSync(dirPath, { recursive: true, mode: 0o700 });
|
|
41
|
+
} else {
|
|
42
|
+
// Fix permissions if directory already exists
|
|
43
|
+
try {
|
|
44
|
+
fs.chmodSync(dirPath, 0o700);
|
|
45
|
+
} catch (err) {
|
|
46
|
+
// Ignore permission errors on some systems
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
35
50
|
|
|
36
51
|
function showWelcome() {
|
|
37
52
|
console.clear();
|
|
@@ -116,10 +131,25 @@ async function installTribeCLIQuiet() {
|
|
|
116
131
|
await downloadFile(downloadUrl, tribeDest);
|
|
117
132
|
fs.chmodSync(tribeDest, '755');
|
|
118
133
|
|
|
134
|
+
// Also download tutor-collector binary
|
|
135
|
+
const tutorCollectorDest = path.join(tribeBinDir, 'tutor-collector');
|
|
136
|
+
const tutorCollectorUrl = `https://github.com/${githubRepo}/releases/latest/download/tutor-collector-${platform}-${arch}`;
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
await downloadFile(tutorCollectorUrl, tutorCollectorDest);
|
|
140
|
+
fs.chmodSync(tutorCollectorDest, '755');
|
|
141
|
+
} catch (tutorError) {
|
|
142
|
+
// Tutor collector is optional for basic CLI functionality
|
|
143
|
+
console.warn('Warning: Could not download tutor-collector binary');
|
|
144
|
+
}
|
|
145
|
+
|
|
119
146
|
// Remove macOS quarantine if needed
|
|
120
147
|
if (platform === 'darwin') {
|
|
121
148
|
try {
|
|
122
149
|
execSync(`xattr -d com.apple.quarantine "${tribeDest}"`, { stdio: 'ignore' });
|
|
150
|
+
if (fs.existsSync(tutorCollectorDest)) {
|
|
151
|
+
execSync(`xattr -d com.apple.quarantine "${tutorCollectorDest}"`, { stdio: 'ignore' });
|
|
152
|
+
}
|
|
123
153
|
} catch {
|
|
124
154
|
// Not critical
|
|
125
155
|
}
|
package/package.json
CHANGED
package/tribe.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* TRIBE CLI wrapper for npm users
|
|
5
|
-
* This tries to run the installed tribe binary, or
|
|
5
|
+
* This tries to run the installed tribe binary, or gives installation instructions
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
const { spawn
|
|
8
|
+
const { spawn } = require('child_process');
|
|
9
9
|
const fs = require('fs');
|
|
10
10
|
const path = require('path');
|
|
11
11
|
const os = require('os');
|
|
@@ -26,19 +26,16 @@ if (fs.existsSync(tribeBinPath)) {
|
|
|
26
26
|
process.exit(code || 0);
|
|
27
27
|
});
|
|
28
28
|
} else {
|
|
29
|
-
// Tribe not installed,
|
|
30
|
-
console.log('
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
process.exit(code || 0);
|
|
43
|
-
});
|
|
29
|
+
// Tribe not installed, show installation instructions
|
|
30
|
+
console.log('ā TRIBE CLI not found');
|
|
31
|
+
console.log('');
|
|
32
|
+
console.log('š¦ To install TRIBE CLI, run:');
|
|
33
|
+
console.log(' npx @_xtribe/cli');
|
|
34
|
+
console.log('');
|
|
35
|
+
console.log('š” Then you can use:');
|
|
36
|
+
console.log(' tribe --version');
|
|
37
|
+
console.log(' tribe status');
|
|
38
|
+
console.log(' tribe login');
|
|
39
|
+
console.log('');
|
|
40
|
+
process.exit(1);
|
|
44
41
|
}
|