Skip to content

Commit fb54e0b

Browse files
committed
fix: only send the decryption env if one is specified
1 parent 3cf016d commit fb54e0b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app-config-cli/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,7 @@ export const cli = yargs
896896
},
897897
async (opts) => {
898898
const environmentOptions = await loadEnvironmentOptions(opts);
899+
const environment = currentEnvironment(environmentOptions);
899900

900901
shouldUseSecretAgent(opts.agent);
901902

@@ -924,7 +925,12 @@ export const cli = yargs
924925
throw new EmptyStdinOrPromptResponse('Failed to read from stdin or prompt');
925926
}
926927

927-
const decrypted = await decryptValue(encryptedText, undefined, environmentOptions);
928+
// only use an environment if one was provided - otherwise just find the key to use based on the revision
929+
const decrypted = await decryptValue(
930+
encryptedText,
931+
undefined,
932+
environment ? environmentOptions : undefined,
933+
);
928934

929935
process.stdout.write(JSON.stringify(decrypted));
930936
process.stdout.write('\n');

0 commit comments

Comments
 (0)