gitarsenal-cli 1.8.9 → 1.9.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/bin/gitarsenal.js +41 -2
- package/package.json +1 -1
package/bin/gitarsenal.js
CHANGED
@@ -27,9 +27,48 @@ async function activateVirtualEnvironment() {
|
|
27
27
|
// Try to create virtual environment with uv first
|
28
28
|
const { execSync } = require('child_process');
|
29
29
|
|
30
|
-
// Check if uv is available
|
30
|
+
// Check if uv is available and install it if needed
|
31
|
+
let uvAvailable = false;
|
31
32
|
try {
|
32
33
|
execSync('uv --version', { stdio: 'pipe' });
|
34
|
+
uvAvailable = true;
|
35
|
+
} catch (error) {
|
36
|
+
console.log(chalk.yellow('⚠️ uv not found. Attempting to install...'));
|
37
|
+
|
38
|
+
// Try different methods to install uv
|
39
|
+
const installMethods = [
|
40
|
+
'curl -LsSf https://astral.sh/uv/install.sh | sh',
|
41
|
+
'pip install uv',
|
42
|
+
'pip3 install uv',
|
43
|
+
'cargo install uv'
|
44
|
+
];
|
45
|
+
|
46
|
+
for (const method of installMethods) {
|
47
|
+
try {
|
48
|
+
console.log(chalk.gray(`🔄 Trying to install uv with: ${method}`));
|
49
|
+
|
50
|
+
if (method.includes('curl')) {
|
51
|
+
// For curl installation, we need to handle the shell script
|
52
|
+
execSync(method, {
|
53
|
+
env: { ...process.env, SHELL: '/bin/bash' },
|
54
|
+
stdio: 'inherit'
|
55
|
+
});
|
56
|
+
} else {
|
57
|
+
execSync(method, { stdio: 'inherit' });
|
58
|
+
}
|
59
|
+
|
60
|
+
// Verify installation
|
61
|
+
execSync('uv --version', { stdio: 'pipe' });
|
62
|
+
console.log(chalk.green('✅ uv installed successfully!'));
|
63
|
+
uvAvailable = true;
|
64
|
+
break;
|
65
|
+
} catch (installError) {
|
66
|
+
console.log(chalk.gray(`⚠️ ${method} failed, trying next...`));
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|
70
|
+
|
71
|
+
if (uvAvailable) {
|
33
72
|
console.log(chalk.gray('🔄 Creating virtual environment with uv...'));
|
34
73
|
|
35
74
|
// Create virtual environment with uv
|
@@ -49,7 +88,7 @@ async function activateVirtualEnvironment() {
|
|
49
88
|
|
50
89
|
console.log(chalk.green('✅ Python packages installed successfully!'));
|
51
90
|
|
52
|
-
}
|
91
|
+
} else {
|
53
92
|
console.log(chalk.gray('⚠️ uv not available, trying Python venv...'));
|
54
93
|
|
55
94
|
// Fallback to Python venv
|