From 17df77b6d0a938f0dc095fae60016e5f6c6ac019 Mon Sep 17 00:00:00 2001 From: janssen-tiobe <118828444+janssen-tiobe@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:41:55 +0200 Subject: [PATCH] #34408: Unsetting environment variables a different way --- dist/index.js | 4 +--- src/configuration/tics.ts | 2 -- src/helper/environment.ts | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1697dc56..cc48b4c7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1308,14 +1308,12 @@ class TicsConfiguration { setVariables() { // variable set to replace the loading bar with synchronising... in the install script (0, environment_1.setVariable)('TICSCI', '1'); - logger_1.logger.info(process.env.TICSIDE || "TICSIDE not found"); if (this.mode === Mode.CLIENT || this.mode === Mode.DIAGNOSTIC) { (0, environment_1.setVariable)('TICSIDE', 'GITHUB'); } else if (process.env.TICSIDE) { (0, environment_1.unsetVariable)('TICSIDE'); } - logger_1.logger.info(process.env.TICSIDE || "TICSIDE not found"); // set ticsAuthToken if (this.ticsAuthToken) { (0, environment_1.setVariable)('TICSAUTHTOKEN', this.ticsAuthToken); @@ -1859,7 +1857,7 @@ function setVariable(key, value) { } exports.setVariable = setVariable; function unsetVariable(key) { - delete process.env[key]; + process.env[key] = ''; } exports.unsetVariable = unsetVariable; diff --git a/src/configuration/tics.ts b/src/configuration/tics.ts index 3eb904e9..3b1be619 100644 --- a/src/configuration/tics.ts +++ b/src/configuration/tics.ts @@ -158,13 +158,11 @@ export class TicsConfiguration { // variable set to replace the loading bar with synchronising... in the install script setVariable('TICSCI', '1'); - logger.info(process.env.TICSIDE || "TICSIDE not found") if (this.mode === Mode.CLIENT || this.mode === Mode.DIAGNOSTIC) { setVariable('TICSIDE', 'GITHUB'); } else if (process.env.TICSIDE) { unsetVariable('TICSIDE') } - logger.info(process.env.TICSIDE || "TICSIDE not found") // set ticsAuthToken if (this.ticsAuthToken) { diff --git a/src/helper/environment.ts b/src/helper/environment.ts index 068abfff..a6f37082 100644 --- a/src/helper/environment.ts +++ b/src/helper/environment.ts @@ -3,5 +3,5 @@ export function setVariable(key: string, value: string): void { } export function unsetVariable(key: string): void { - delete process.env[key]; + process.env[key] = ''; } \ No newline at end of file