troxy-cli 1.4.14 → 1.4.15
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 +4 -2
- package/package.json +1 -1
package/bin/troxy.js
CHANGED
|
@@ -355,8 +355,10 @@ switch (command) {
|
|
|
355
355
|
} catch (err) {
|
|
356
356
|
const stderr = err.stderr?.toString() || '';
|
|
357
357
|
if (stderr.includes('ENOTEMPTY')) {
|
|
358
|
-
// npm bug on macOS:
|
|
359
|
-
|
|
358
|
+
// npm bug on macOS/Homebrew: rename fails because dir has contents.
|
|
359
|
+
// rm -rf the stale dir directly, then reinstall cleanly.
|
|
360
|
+
const globalRoot = execSync('npm root -g', { stdio: 'pipe' }).toString().trim();
|
|
361
|
+
execSync(`rm -rf "${globalRoot}/troxy-cli" && npm install -g troxy-cli@latest`, { stdio: 'pipe', shell: true });
|
|
360
362
|
} else {
|
|
361
363
|
throw err;
|
|
362
364
|
}
|