Skip to content

Commit

Permalink
Emit a diff of each environment variable (#296)
Browse files Browse the repository at this point in the history
Fixes #295
  • Loading branch information
sethvargo committed Apr 17, 2023
1 parent 430ae13 commit 14b54cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/main/index.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/main.ts
Expand Up @@ -299,8 +299,12 @@ async function main() {
function exportVariableAndWarn(key: string, value: string) {
const existing = process.env[key];
if (existing && existing !== value) {
const old = JSON.stringify(existing);
logWarning(`Overwriting existing environment variable ${key} (was: ${old})`);
logWarning(
`Overwriting existing environment variable ${key}:
- ${JSON.stringify(existing)}
+ ${JSON.stringify(value)}
`.trim(),
);
}

exportVariable(key, value);
Expand Down

0 comments on commit 14b54cc

Please sign in to comment.