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) => {
|
resetEnvPairs: (target) => {
|
||||||
for (const [name, orginalValue] of originals) {
|
for (const [name, orginalValue] of originals) {
|
||||||
if (orginalValue) {
|
if (typeof orginalValue === "string") {
|
||||||
target[name] = orginalValue;
|
target[name] = orginalValue;
|
||||||
} else {
|
} else {
|
||||||
delete target[name];
|
delete target[name];
|
||||||
|
|||||||
@ -22,6 +22,7 @@ const expectedEnv = {
|
|||||||
ELECTRON_RUN_AS_NODE: "1",
|
ELECTRON_RUN_AS_NODE: "1",
|
||||||
ELECTRON_NO_ATTACH_CONSOLE: "1",
|
ELECTRON_NO_ATTACH_CONSOLE: "1",
|
||||||
TERM: "screen-256color-bce",
|
TERM: "screen-256color-bce",
|
||||||
|
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||||
};
|
};
|
||||||
|
|
||||||
describe("computeUnixShellEnvironment technical tests", () => {
|
describe("computeUnixShellEnvironment technical tests", () => {
|
||||||
@ -78,6 +79,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
|||||||
di.override(processEnvInjectable, () => ({
|
di.override(processEnvInjectable, () => ({
|
||||||
SOME_ENV_VAR: "some-env-value",
|
SOME_ENV_VAR: "some-env-value",
|
||||||
TERM: "some-other-value",
|
TERM: "some-other-value",
|
||||||
|
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||||
}));
|
}));
|
||||||
di.override(processExecPathInjectable, () => "/some/process/exec/path");
|
di.override(processExecPathInjectable, () => "/some/process/exec/path");
|
||||||
|
|
||||||
@ -178,6 +180,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
|||||||
PATH: "/bin",
|
PATH: "/bin",
|
||||||
SOME_ENV_VAR: "some-env-value",
|
SOME_ENV_VAR: "some-env-value",
|
||||||
TERM: "some-other-value",
|
TERM: "some-other-value",
|
||||||
|
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -279,6 +282,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
|||||||
PATH: "/bin",
|
PATH: "/bin",
|
||||||
SOME_ENV_VAR: "some-env-value",
|
SOME_ENV_VAR: "some-env-value",
|
||||||
TERM: "some-other-value",
|
TERM: "some-other-value",
|
||||||
|
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -379,6 +383,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
|||||||
PATH: "/bin",
|
PATH: "/bin",
|
||||||
SOME_ENV_VAR: "some-env-value",
|
SOME_ENV_VAR: "some-env-value",
|
||||||
TERM: "some-other-value",
|
TERM: "some-other-value",
|
||||||
|
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -478,6 +483,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
|||||||
PATH: "/bin",
|
PATH: "/bin",
|
||||||
SOME_ENV_VAR: "some-env-value",
|
SOME_ENV_VAR: "some-env-value",
|
||||||
TERM: "some-other-value",
|
TERM: "some-other-value",
|
||||||
|
SOME_THIRD_NON_UNDEFINED_VALUE: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user