troxy-cli 1.4.10 → 1.4.11
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/troxy.js +11 -1
- package/package.json +1 -1
package/bin/troxy.js
CHANGED
|
@@ -342,7 +342,17 @@ switch (command) {
|
|
|
342
342
|
console.log(`${current} → ${latest}`);
|
|
343
343
|
process.stdout.write(' Installing... ');
|
|
344
344
|
try {
|
|
345
|
-
|
|
345
|
+
try {
|
|
346
|
+
execSync('npm install -g troxy-cli@latest', { stdio: 'pipe' });
|
|
347
|
+
} catch (err) {
|
|
348
|
+
const stderr = err.stderr?.toString() || '';
|
|
349
|
+
if (stderr.includes('ENOTEMPTY')) {
|
|
350
|
+
// npm bug on macOS: global package dir not empty during rename — uninstall first
|
|
351
|
+
execSync('npm uninstall -g troxy-cli && npm install -g troxy-cli@latest', { stdio: 'pipe', shell: true });
|
|
352
|
+
} else {
|
|
353
|
+
throw err;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
346
356
|
console.log(`✓\n\n Updated to ${latest}. Restart your terminal to use the new version.\n`);
|
|
347
357
|
} catch (err) {
|
|
348
358
|
const stderr = err.stderr?.toString() || err.message || '';
|