vibe-annotations-server 0.1.4 → 0.1.5
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/index.js +16 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -24,8 +24,9 @@ function log(message, color = '') {
|
|
|
24
24
|
|
|
25
25
|
function checkIfInstalled() {
|
|
26
26
|
try {
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
// Check if globally installed via npm
|
|
28
|
+
const output = execSync('npm list -g --depth=0 --parseable', { encoding: 'utf8' });
|
|
29
|
+
return output.includes('vibe-annotations-server');
|
|
29
30
|
} catch {
|
|
30
31
|
return false;
|
|
31
32
|
}
|
|
@@ -94,7 +95,19 @@ function uninstallServer() {
|
|
|
94
95
|
let childProcess = null;
|
|
95
96
|
|
|
96
97
|
function runCommand(args) {
|
|
97
|
-
|
|
98
|
+
// Use global npm bin path to ensure we run the globally installed version
|
|
99
|
+
let command = COMMAND_NAME;
|
|
100
|
+
try {
|
|
101
|
+
const globalBin = execSync('npm bin -g', { encoding: 'utf8' }).trim();
|
|
102
|
+
const globalCommand = `${globalBin}/${COMMAND_NAME}`;
|
|
103
|
+
if (require('fs').existsSync(globalCommand)) {
|
|
104
|
+
command = globalCommand;
|
|
105
|
+
}
|
|
106
|
+
} catch {
|
|
107
|
+
// Fallback to command name in PATH
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
childProcess = spawn(command, args, { stdio: 'inherit' });
|
|
98
111
|
|
|
99
112
|
childProcess.on('error', (error) => {
|
|
100
113
|
if (error.code === 'ENOENT') {
|