@insforge/cli 0.1.16 → 0.1.18
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/dist/index.js +6 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -694,33 +694,6 @@ ${missing.join("\n")}
|
|
|
694
694
|
`;
|
|
695
695
|
appendFileSync(gitignorePath, block);
|
|
696
696
|
}
|
|
697
|
-
async function isCliInstalledGlobally() {
|
|
698
|
-
try {
|
|
699
|
-
await execAsync("insforge --version");
|
|
700
|
-
return true;
|
|
701
|
-
} catch {
|
|
702
|
-
return false;
|
|
703
|
-
}
|
|
704
|
-
}
|
|
705
|
-
async function promptCliInstall(json) {
|
|
706
|
-
if (json) return;
|
|
707
|
-
try {
|
|
708
|
-
if (await isCliInstalledGlobally()) return;
|
|
709
|
-
const shouldInstall = await clack5.confirm({
|
|
710
|
-
message: "Would you like to install the InsForge CLI globally? (so you can run `insforge` directly)"
|
|
711
|
-
});
|
|
712
|
-
if (clack5.isCancel(shouldInstall) || !shouldInstall) {
|
|
713
|
-
clack5.log.info("You can install it later with: npm install -g @insforge/cli");
|
|
714
|
-
return;
|
|
715
|
-
}
|
|
716
|
-
const s = clack5.spinner();
|
|
717
|
-
s.start("Installing @insforge/cli globally...");
|
|
718
|
-
await execAsync("npm install -g @insforge/cli", { timeout: 6e4 });
|
|
719
|
-
s.stop("InsForge CLI installed globally");
|
|
720
|
-
} catch {
|
|
721
|
-
clack5.log.warn("Failed to install CLI globally. You can run manually: npm install -g @insforge/cli");
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
697
|
async function installSkills(json) {
|
|
725
698
|
try {
|
|
726
699
|
if (!json) clack5.log.info("Installing InsForge agent skills...");
|
|
@@ -845,7 +818,6 @@ function registerProjectLinkCommand(program2) {
|
|
|
845
818
|
} else {
|
|
846
819
|
outputSuccess(`Linked to project "${project.name}" (${project.appkey}.${project.region})`);
|
|
847
820
|
}
|
|
848
|
-
await promptCliInstall(json);
|
|
849
821
|
await installSkills(json);
|
|
850
822
|
await reportCliUsage("cli.link", true, 6);
|
|
851
823
|
} catch (err) {
|
|
@@ -1648,10 +1620,10 @@ function registerStorageDeleteBucketCommand(storageCmd2) {
|
|
|
1648
1620
|
try {
|
|
1649
1621
|
await requireAuth();
|
|
1650
1622
|
if (!yes && !json) {
|
|
1651
|
-
const
|
|
1623
|
+
const confirm7 = await clack7.confirm({
|
|
1652
1624
|
message: `Delete bucket "${name}" and all its objects? This cannot be undone.`
|
|
1653
1625
|
});
|
|
1654
|
-
if (!
|
|
1626
|
+
if (!confirm7 || clack7.isCancel(confirm7)) {
|
|
1655
1627
|
process.exit(0);
|
|
1656
1628
|
}
|
|
1657
1629
|
}
|
|
@@ -1997,7 +1969,6 @@ function registerCreateCommand(program2) {
|
|
|
1997
1969
|
if (hasTemplate) {
|
|
1998
1970
|
await downloadTemplate(template, projectConfig, projectName, json, apiUrl);
|
|
1999
1971
|
}
|
|
2000
|
-
await promptCliInstall(json);
|
|
2001
1972
|
await installSkills(json);
|
|
2002
1973
|
await reportCliUsage("cli.create", true, 6);
|
|
2003
1974
|
if (hasTemplate) {
|
|
@@ -2500,10 +2471,10 @@ function registerSecretsDeleteCommand(secretsCmd2) {
|
|
|
2500
2471
|
try {
|
|
2501
2472
|
await requireAuth();
|
|
2502
2473
|
if (!yes && !json) {
|
|
2503
|
-
const
|
|
2474
|
+
const confirm7 = await clack11.confirm({
|
|
2504
2475
|
message: `Delete secret "${key}"? This cannot be undone.`
|
|
2505
2476
|
});
|
|
2506
|
-
if (!
|
|
2477
|
+
if (!confirm7 || clack11.isCancel(confirm7)) {
|
|
2507
2478
|
process.exit(0);
|
|
2508
2479
|
}
|
|
2509
2480
|
}
|
|
@@ -2686,10 +2657,10 @@ function registerSchedulesDeleteCommand(schedulesCmd2) {
|
|
|
2686
2657
|
try {
|
|
2687
2658
|
await requireAuth();
|
|
2688
2659
|
if (!yes && !json) {
|
|
2689
|
-
const
|
|
2660
|
+
const confirm7 = await clack12.confirm({
|
|
2690
2661
|
message: `Delete schedule "${id}"? This cannot be undone.`
|
|
2691
2662
|
});
|
|
2692
|
-
if (!
|
|
2663
|
+
if (!confirm7 || clack12.isCancel(confirm7)) {
|
|
2693
2664
|
process.exit(0);
|
|
2694
2665
|
}
|
|
2695
2666
|
}
|