mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Co-authored-by: paperdave <paperdave@users.noreply.github.com> Co-authored-by: Ashcon Partovi <ashcon@partovi.net> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
20 lines
491 B
TypeScript
20 lines
491 B
TypeScript
import * as harness from "./harness";
|
|
|
|
// We make Bun.env read-only
|
|
// so process.env = {} causes them to be out of sync and we assume Bun.env is
|
|
for (let key in process.env) {
|
|
if (key === "TZ") continue;
|
|
if (key in harness.bunEnv) continue;
|
|
delete process.env[key];
|
|
}
|
|
|
|
for (let key in harness.bunEnv) {
|
|
if (key === "TZ") continue;
|
|
if (harness.bunEnv[key] === undefined) {
|
|
continue;
|
|
}
|
|
process.env[key] = harness.bunEnv[key] + "";
|
|
}
|
|
|
|
if (Bun.$?.env) Bun.$.env(process.env);
|