mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix handling of '' in env
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
a222d91ade
commit
fb196f376b
@ -32,7 +32,7 @@ const getResetProcessEnv = (src: Partial<Record<string, string>>, overrides: Par
|
||||
},
|
||||
resetEnvPairs: (target) => {
|
||||
for (const [name, orginalValue] of originals) {
|
||||
if (orginalValue) {
|
||||
if (typeof orginalValue === "string") {
|
||||
target[name] = orginalValue;
|
||||
} else {
|
||||
delete target[name];
|
||||
|
||||
@ -22,6 +22,7 @@ const expectedEnv = {
|
||||
ELECTRON_RUN_AS_NODE: "1",
|
||||
ELECTRON_NO_ATTACH_CONSOLE: "1",
|
||||
TERM: "screen-256color-bce",
|
||||
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||
};
|
||||
|
||||
describe("computeUnixShellEnvironment technical tests", () => {
|
||||
@ -78,6 +79,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
||||
di.override(processEnvInjectable, () => ({
|
||||
SOME_ENV_VAR: "some-env-value",
|
||||
TERM: "some-other-value",
|
||||
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||
}));
|
||||
di.override(processExecPathInjectable, () => "/some/process/exec/path");
|
||||
|
||||
@ -178,6 +180,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
||||
PATH: "/bin",
|
||||
SOME_ENV_VAR: "some-env-value",
|
||||
TERM: "some-other-value",
|
||||
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||
},
|
||||
});
|
||||
});
|
||||
@ -279,6 +282,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
||||
PATH: "/bin",
|
||||
SOME_ENV_VAR: "some-env-value",
|
||||
TERM: "some-other-value",
|
||||
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||
},
|
||||
});
|
||||
});
|
||||
@ -379,6 +383,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
||||
PATH: "/bin",
|
||||
SOME_ENV_VAR: "some-env-value",
|
||||
TERM: "some-other-value",
|
||||
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||
},
|
||||
});
|
||||
});
|
||||
@ -478,6 +483,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
||||
PATH: "/bin",
|
||||
SOME_ENV_VAR: "some-env-value",
|
||||
TERM: "some-other-value",
|
||||
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user