aicodeswitch 1.3.0 → 1.3.1

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/update.js +7 -7
  2. package/package.json +1 -1
package/bin/update.js CHANGED
@@ -268,19 +268,19 @@ const update = async () => {
268
268
  color: 'cyan'
269
269
  }).start();
270
270
 
271
- try {
272
- const npmArgs = ['install', '-g', `${PACKAGE_NAME}@latest`];
273
- if (needSudo) {
274
- npmArgs.unshift('sudo');
275
- }
271
+ const npmArgs = ['npm', 'install', '-g', `${PACKAGE_NAME}@latest`];
272
+ if (needSudo) {
273
+ npmArgs.unshift('sudo');
274
+ }
276
275
 
277
- await execCommand(needSudo ? 'sudo' : 'npm', npmArgs);
276
+ try {
277
+ await execCommand(npmArgs);
278
278
  updateSpinner.succeed(chalk.green('Update successful!'));
279
279
  } catch (err) {
280
280
  updateSpinner.fail(chalk.red('Update failed'));
281
281
  console.log(chalk.yellow(`\nUpdate failed with error code ${err.code || 'unknown'}\n`));
282
282
  console.log(chalk.white('You can try manually updating:\n'));
283
- console.log(chalk.cyan(` ${needSudo ? 'sudo ' : ''}npm install -g ${PACKAGE_NAME}@latest\n`));
283
+ console.log(chalk.cyan(` ${npmArgs.join(' ')}\n`));
284
284
 
285
285
  // 尝试重新启动服务器
286
286
  console.log(chalk.yellow('Attempting to restart server...\n'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicodeswitch",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A tool to help you manage AI programming tools to access large language models locally. It allows your Claude Code, Codex and other tools to no longer be limited to official models.",
5
5
  "author": "tangshuang",
6
6
  "license": "MIT",