Only emit a warning if the envvar has changed (#245)

This commit is contained in:
Seth Vargo 2022-11-26 09:00:48 -05:00 committed by GitHub
parent 400b51b0c2
commit 23620afd0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

2
dist/main/index.js vendored

File diff suppressed because one or more lines are too long

View File

@ -298,7 +298,7 @@ async function main() {
*/ */
function exportVariableAndWarn(key: string, value: string) { function exportVariableAndWarn(key: string, value: string) {
const existing = process.env[key]; const existing = process.env[key];
if (existing) { if (existing && existing !== value) {
const old = JSON.stringify(existing); const old = JSON.stringify(existing);
logWarning(`Overwriting existing environment variable ${key} (was: ${old})`); logWarning(`Overwriting existing environment variable ${key} (was: ${old})`);
} }