gitarsenal-cli 1.9.2 → 1.9.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/.venv_status.json +1 -1
- package/bin/gitarsenal.js +31 -15
- package/package.json +1 -1
package/.venv_status.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"created":"2025-08-02T15:
|
|
1
|
+
{"created":"2025-08-02T15:59:21.667Z","packages":["modal","gitingest","requests"],"uv_version":"uv 0.8.3 (7e78f54e7 2025-07-24)"}
|
package/bin/gitarsenal.js
CHANGED
|
@@ -39,39 +39,55 @@ function activateVirtualEnvironment() {
|
|
|
39
39
|
if (fs.existsSync(statusFile)) {
|
|
40
40
|
try {
|
|
41
41
|
const status = JSON.parse(fs.readFileSync(statusFile, 'utf8'));
|
|
42
|
-
console.log(chalk.gray(`✅ Virtual environment created: ${status.created}`));
|
|
42
|
+
// console.log(chalk.gray(`✅ Virtual environment created: ${status.created}`));
|
|
43
43
|
console.log(chalk.gray(`📦 Packages: ${status.packages.join(', ')}`));
|
|
44
44
|
} catch (error) {
|
|
45
45
|
console.log(chalk.gray('✅ Virtual environment found'));
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
// Verify virtual environment structure
|
|
50
|
-
|
|
49
|
+
// Verify virtual environment structure - uv creates different structure
|
|
50
|
+
let pythonPath, pipPath;
|
|
51
|
+
|
|
52
|
+
// Check for uv-style virtual environment first
|
|
53
|
+
const uvPythonPath = path.join(venvPath, 'bin', 'python');
|
|
54
|
+
const uvPipPath = path.join(venvPath, 'bin', 'pip');
|
|
55
|
+
|
|
56
|
+
// Check for traditional venv structure
|
|
57
|
+
const traditionalPythonPath = isWindows ?
|
|
51
58
|
path.join(venvPath, 'Scripts', 'python.exe') :
|
|
52
59
|
path.join(venvPath, 'bin', 'python');
|
|
53
|
-
|
|
54
|
-
const pipPath = isWindows ?
|
|
60
|
+
const traditionalPipPath = isWindows ?
|
|
55
61
|
path.join(venvPath, 'Scripts', 'pip.exe') :
|
|
56
62
|
path.join(venvPath, 'bin', 'pip');
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
64
|
+
// Determine which structure exists
|
|
65
|
+
// console.log(chalk.gray(`🔍 Checking virtual environment structure:`));
|
|
66
|
+
// console.log(chalk.gray(` Python: ${uvPythonPath} (exists: ${fs.existsSync(uvPythonPath)})`));
|
|
67
|
+
// console.log(chalk.gray(` Pip: ${uvPipPath} (exists: ${fs.existsSync(uvPipPath)})`));
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
// For uv virtual environments, we only need Python to exist
|
|
70
|
+
// uv doesn't create a pip executable, it uses 'uv pip' instead
|
|
71
|
+
if (fs.existsSync(uvPythonPath)) {
|
|
72
|
+
pythonPath = uvPythonPath;
|
|
73
|
+
pipPath = 'uv pip'; // Use uv pip instead of pip executable
|
|
74
|
+
// console.log(chalk.gray('✅ Found uv-style virtual environment'));
|
|
75
|
+
} else if (fs.existsSync(traditionalPythonPath) && fs.existsSync(traditionalPipPath)) {
|
|
76
|
+
pythonPath = traditionalPythonPath;
|
|
77
|
+
pipPath = traditionalPipPath;
|
|
78
|
+
console.log(chalk.gray('✅ Found traditional virtual environment'));
|
|
79
|
+
} else {
|
|
80
|
+
console.log(chalk.red('❌ Virtual environment structure not recognized'));
|
|
81
|
+
console.log(chalk.gray('Expected Python at:'));
|
|
82
|
+
console.log(chalk.gray(` ${uvPythonPath}`));
|
|
83
|
+
console.log(chalk.gray(` ${traditionalPythonPath}`));
|
|
66
84
|
console.log(chalk.yellow('💡 Please reinstall the package'));
|
|
67
85
|
return false;
|
|
68
86
|
}
|
|
69
87
|
|
|
70
88
|
// Update PATH to prioritize virtual environment
|
|
71
89
|
const pathSeparator = isWindows ? ';' : ':';
|
|
72
|
-
const venvBinPath =
|
|
73
|
-
path.join(venvPath, 'Scripts') :
|
|
74
|
-
path.join(venvPath, 'bin');
|
|
90
|
+
const venvBinPath = path.dirname(pythonPath); // Use the same directory as the Python executable
|
|
75
91
|
|
|
76
92
|
process.env.PATH = `${venvBinPath}${pathSeparator}${process.env.PATH}`;
|
|
77
93
|
process.env.VIRTUAL_ENV = venvPath;
|