troxy-cli 1.4.13 → 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 +7 -3
- package/package.json +1 -1
package/bin/troxy.js
CHANGED
|
@@ -355,13 +355,17 @@ 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
|
}
|
|
363
365
|
}
|
|
364
|
-
|
|
366
|
+
// Also refresh the npx cache so MCP servers (e.g. OpenClaw) pick up the new version
|
|
367
|
+
try { execSync(`npx --yes troxy-cli@${latest} --version`, { stdio: 'pipe' }); } catch { /* non-fatal */ }
|
|
368
|
+
console.log(`✓\n\n Updated to ${latest}. Restart your terminal and any MCP clients to use the new version.\n`);
|
|
365
369
|
} catch (err) {
|
|
366
370
|
const stderr = err.stderr?.toString() || err.message || '';
|
|
367
371
|
if (stderr.includes('EACCES') || stderr.includes('permission')) {
|