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.
Files changed (2) hide show
  1. package/bin/troxy.js +11 -1
  2. 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
- execSync('npm install -g troxy-cli@latest', { stdio: 'pipe' });
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 || '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "troxy-cli",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "description": "AI payment control — protect your agent's payments with policies",
5
5
  "type": "module",
6
6
  "bin": {