vibe-annotations-server 0.1.0 â 0.1.2
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 +48 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -53,6 +53,43 @@ function installFromGitHub() {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
function uninstallServer() {
|
|
57
|
+
log('đī¸ Uninstalling vibe-annotations-server...', colors.cyan);
|
|
58
|
+
|
|
59
|
+
// First try to stop the server if it's running
|
|
60
|
+
try {
|
|
61
|
+
log(' Stopping server first...', colors.dim);
|
|
62
|
+
execSync(`${COMMAND_NAME} stop`, { stdio: 'ignore' });
|
|
63
|
+
} catch {
|
|
64
|
+
// Server might not be running, continue
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Check if server is currently installed
|
|
68
|
+
if (!checkIfInstalled()) {
|
|
69
|
+
log('âšī¸ vibe-annotations-server is not globally installed', colors.yellow);
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Attempt to uninstall
|
|
74
|
+
try {
|
|
75
|
+
execSync('npm uninstall -g vibe-annotations-server', { stdio: 'inherit' });
|
|
76
|
+
|
|
77
|
+
// Verify uninstallation worked
|
|
78
|
+
if (!checkIfInstalled()) {
|
|
79
|
+
log('â
Successfully uninstalled vibe-annotations-server!', colors.green);
|
|
80
|
+
log(' Server command is no longer available', colors.dim);
|
|
81
|
+
return true;
|
|
82
|
+
} else {
|
|
83
|
+
log('â ī¸ Uninstall command ran, but server still appears to be installed', colors.yellow);
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
} catch (error) {
|
|
87
|
+
log('â Failed to uninstall. Please try manually:', colors.yellow);
|
|
88
|
+
log(' npm uninstall -g vibe-annotations-server', colors.dim);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
56
93
|
function runCommand(args) {
|
|
57
94
|
const child = spawn(COMMAND_NAME, args, { stdio: 'inherit' });
|
|
58
95
|
|
|
@@ -79,6 +116,13 @@ function main() {
|
|
|
79
116
|
return;
|
|
80
117
|
}
|
|
81
118
|
|
|
119
|
+
// Handle uninstall command
|
|
120
|
+
if (args[0] === 'uninstall') {
|
|
121
|
+
log('đ Vibe Annotations Server - Uninstall', colors.bright);
|
|
122
|
+
const success = uninstallServer();
|
|
123
|
+
process.exit(success ? 0 : 1);
|
|
124
|
+
}
|
|
125
|
+
|
|
82
126
|
log('đ Vibe Annotations Server', colors.bright);
|
|
83
127
|
|
|
84
128
|
// Check if vibe-annotations-server is installed
|
|
@@ -97,9 +141,12 @@ function main() {
|
|
|
97
141
|
}
|
|
98
142
|
}
|
|
99
143
|
|
|
144
|
+
// If no arguments provided, default to 'start'
|
|
145
|
+
const finalArgs = args.length === 0 ? ['start'] : args;
|
|
146
|
+
|
|
100
147
|
// Run the actual command
|
|
101
148
|
log('đ Starting server...', colors.cyan);
|
|
102
|
-
runCommand(
|
|
149
|
+
runCommand(finalArgs);
|
|
103
150
|
}
|
|
104
151
|
|
|
105
152
|
// Handle Ctrl+C gracefully
|