zcf 2.9.3 → 2.9.4
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.
|
@@ -18,7 +18,7 @@ import { promisify as promisify$1 } from 'node:util';
|
|
|
18
18
|
import { homedir, platform } from 'node:os';
|
|
19
19
|
import { join as join$2 } from 'node:path';
|
|
20
20
|
|
|
21
|
-
const version = "2.9.
|
|
21
|
+
const version = "2.9.4";
|
|
22
22
|
const homepage = "https://github.com/UfoMiao/zcf";
|
|
23
23
|
|
|
24
24
|
const common$1 = {
|
|
@@ -2597,15 +2597,10 @@ async function isCcrInstalled() {
|
|
|
2597
2597
|
}
|
|
2598
2598
|
async function installCcr(scriptLang) {
|
|
2599
2599
|
const i18n = getTranslation(scriptLang);
|
|
2600
|
-
|
|
2601
|
-
if (installed) {
|
|
2602
|
-
console.log(ansis.green(`\u2714 ${i18n.ccr.ccrAlreadyInstalled}`));
|
|
2603
|
-
await updateCcr(scriptLang);
|
|
2604
|
-
return;
|
|
2605
|
-
}
|
|
2606
|
-
console.log(ansis.cyan(`\u{1F4E6} ${i18n.ccr.installingCcr}`));
|
|
2600
|
+
let hasIncorrectPackage = false;
|
|
2607
2601
|
try {
|
|
2608
2602
|
await execAsync$1("npm list -g claude-code-router");
|
|
2603
|
+
hasIncorrectPackage = true;
|
|
2609
2604
|
console.log(ansis.yellow(`\u26A0 ${i18n.ccr.detectedIncorrectPackage}`));
|
|
2610
2605
|
try {
|
|
2611
2606
|
await execAsync$1("npm uninstall -g claude-code-router");
|
|
@@ -2615,6 +2610,13 @@ async function installCcr(scriptLang) {
|
|
|
2615
2610
|
}
|
|
2616
2611
|
} catch {
|
|
2617
2612
|
}
|
|
2613
|
+
const installed = await isCcrInstalled();
|
|
2614
|
+
if (installed && !hasIncorrectPackage) {
|
|
2615
|
+
console.log(ansis.green(`\u2714 ${i18n.ccr.ccrAlreadyInstalled}`));
|
|
2616
|
+
await updateCcr(scriptLang);
|
|
2617
|
+
return;
|
|
2618
|
+
}
|
|
2619
|
+
console.log(ansis.cyan(`\u{1F4E6} ${i18n.ccr.installingCcr}`));
|
|
2618
2620
|
try {
|
|
2619
2621
|
await execAsync$1("npm install -g @musistudio/claude-code-router --force");
|
|
2620
2622
|
console.log(ansis.green(`\u2714 ${i18n.ccr.ccrInstallSuccess}`));
|
package/package.json
CHANGED