climaybe 1.4.2 → 1.4.3
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/bin/version.txt +1 -1
- package/package.json +1 -1
- package/src/commands/init.js +13 -10
package/bin/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.4.
|
|
1
|
+
1.4.3
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -140,12 +140,12 @@ async function runInitFlow() {
|
|
|
140
140
|
const existingNames =
|
|
141
141
|
ciHost === 'github' ? listGitHubSecrets() : listGitLabVariables();
|
|
142
142
|
const namesWeWillPrompt = new Set(secretsToPrompt.map((s) => s.name));
|
|
143
|
-
const alreadySet = existingNames.filter((n) => namesWeWillPrompt.has(n));
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
143
|
+
const alreadySet = new Set(existingNames.filter((n) => namesWeWillPrompt.has(n)));
|
|
144
|
+
let doUpdateExisting = true;
|
|
145
|
+
if (alreadySet.size > 0) {
|
|
146
|
+
doUpdateExisting = await promptUpdateExistingSecrets([...alreadySet]);
|
|
147
|
+
if (!doUpdateExisting) {
|
|
148
|
+
console.log(pc.dim('\n Skipping only the secret(s) already set; will still prompt for the rest.\n'));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -159,6 +159,7 @@ async function runInitFlow() {
|
|
|
159
159
|
stores,
|
|
160
160
|
});
|
|
161
161
|
for (const { name, value } of storeUrlSecrets) {
|
|
162
|
+
if (alreadySet.has(name) && !doUpdateExisting) continue;
|
|
162
163
|
try {
|
|
163
164
|
await setter.set(name, value);
|
|
164
165
|
console.log(pc.green(` Set ${name} (from store config).`));
|
|
@@ -168,10 +169,12 @@ async function runInitFlow() {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
172
|
+
const toPrompt = secretsToPrompt.filter((s) => !alreadySet.has(s.name) || doUpdateExisting);
|
|
173
|
+
const totalToPrompt = toPrompt.length;
|
|
174
|
+
console.log(pc.cyan(`\n Configure ${totalToPrompt} ${setter.name} secret(s)/variable(s). Leave optional ones blank to skip.\n`));
|
|
175
|
+
for (let i = 0; i < toPrompt.length; i++) {
|
|
176
|
+
const secret = toPrompt[i];
|
|
177
|
+
const value = await promptSecretValue(secret, i, totalToPrompt);
|
|
175
178
|
if (!value) continue;
|
|
176
179
|
|
|
177
180
|
const isThemeToken =
|