@foir/cli 0.72.0 → 0.72.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.
- package/dist/cli.js +21 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13824,6 +13824,17 @@ function projectPinProblem(block, resolved) {
|
|
|
13824
13824
|
}
|
|
13825
13825
|
return null;
|
|
13826
13826
|
}
|
|
13827
|
+
async function signingSecretForEnv(read) {
|
|
13828
|
+
try {
|
|
13829
|
+
const { secret } = await read();
|
|
13830
|
+
return { secret };
|
|
13831
|
+
} catch (error) {
|
|
13832
|
+
if (error instanceof ConnectError9 && error.code === Code9.PermissionDenied) {
|
|
13833
|
+
return { skipped: error.rawMessage };
|
|
13834
|
+
}
|
|
13835
|
+
throw error;
|
|
13836
|
+
}
|
|
13837
|
+
}
|
|
13827
13838
|
function syncEnvVar(envPath, key, value, options) {
|
|
13828
13839
|
const envContent = existsSync7(envPath) ? readFileSync3(envPath, "utf-8") : "";
|
|
13829
13840
|
const pattern = new RegExp(`^${key}=(.*)$`, "m");
|
|
@@ -14593,7 +14604,16 @@ function registerPushCommand(program, globalOpts) {
|
|
|
14593
14604
|
);
|
|
14594
14605
|
}
|
|
14595
14606
|
}
|
|
14596
|
-
const
|
|
14607
|
+
const signing = await signingSecretForEnv(() => client.operations.getSigningSecret());
|
|
14608
|
+
const signingSecret = "secret" in signing ? signing.secret : "";
|
|
14609
|
+
if ("skipped" in signing) {
|
|
14610
|
+
console.log(
|
|
14611
|
+
chalk10.yellow(`\u26A0 Signing secret: not synced to ${envPath}. This credential may not read it (${signing.skipped}).`)
|
|
14612
|
+
);
|
|
14613
|
+
console.log(
|
|
14614
|
+
chalk10.dim(" The push applied; only the .env sync was skipped, and FOIR_WEBHOOK_SECRET and FOIR_SIGNING_SECRET were left as they are.") + chalk10.dim(" To sync them, run push with a credential that holds opsecrets:read.")
|
|
14615
|
+
);
|
|
14616
|
+
}
|
|
14597
14617
|
if (signingSecret) {
|
|
14598
14618
|
const syncAndLog = (key, label) => {
|
|
14599
14619
|
const result = syncEnvVar(envPath, key, signingSecret, {
|