@keywaysh/cli 0.1.9 → 0.1.10
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/cli.js +12 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -101,7 +101,7 @@ var INTERNAL_POSTHOG_HOST = "https://eu.i.posthog.com";
|
|
|
101
101
|
// package.json
|
|
102
102
|
var package_default = {
|
|
103
103
|
name: "@keywaysh/cli",
|
|
104
|
-
version: "0.1.
|
|
104
|
+
version: "0.1.10",
|
|
105
105
|
description: "One link to all your secrets",
|
|
106
106
|
type: "module",
|
|
107
107
|
bin: {
|
|
@@ -2448,11 +2448,12 @@ Connection to ${providerDisplayName} failed.`));
|
|
|
2448
2448
|
}
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
|
+
let diff;
|
|
2451
2452
|
if (needsDirectionPrompt) {
|
|
2452
2453
|
const effectiveKeywayEnv = keywayEnv || "production";
|
|
2453
2454
|
const effectiveProviderEnv = providerEnv || mapToProviderEnvironment(provider, effectiveKeywayEnv);
|
|
2454
2455
|
console.log(pc10.gray("\nComparing secrets..."));
|
|
2455
|
-
|
|
2456
|
+
diff = await getSyncDiff(accessToken, repoFullName, {
|
|
2456
2457
|
connectionId: connection.id,
|
|
2457
2458
|
projectId: selectedProject.id,
|
|
2458
2459
|
serviceId: selectedProject.serviceId,
|
|
@@ -2466,7 +2467,13 @@ Connection to ${providerDisplayName} failed.`));
|
|
|
2466
2467
|
return;
|
|
2467
2468
|
}
|
|
2468
2469
|
}
|
|
2469
|
-
if (needsDirectionPrompt) {
|
|
2470
|
+
if (needsDirectionPrompt && diff) {
|
|
2471
|
+
let defaultDirection = 0;
|
|
2472
|
+
if (diff.keywayCount === 0 && diff.providerCount > 0) {
|
|
2473
|
+
defaultDirection = 1;
|
|
2474
|
+
} else if (diff.providerCount === 0 && diff.keywayCount > 0) {
|
|
2475
|
+
defaultDirection = 0;
|
|
2476
|
+
}
|
|
2470
2477
|
const { selectedDirection } = await prompts7({
|
|
2471
2478
|
type: "select",
|
|
2472
2479
|
name: "selectedDirection",
|
|
@@ -2474,7 +2481,8 @@ Connection to ${providerDisplayName} failed.`));
|
|
|
2474
2481
|
choices: [
|
|
2475
2482
|
{ title: `Keyway \u2192 ${providerName}`, value: "push" },
|
|
2476
2483
|
{ title: `${providerName} \u2192 Keyway`, value: "pull" }
|
|
2477
|
-
]
|
|
2484
|
+
],
|
|
2485
|
+
initial: defaultDirection
|
|
2478
2486
|
});
|
|
2479
2487
|
if (!selectedDirection) {
|
|
2480
2488
|
console.log(pc10.gray("Cancelled."));
|