Fix packaged node entrypoint env preservation
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
import { pathToFileURL } from "node:url";
|
||||
|
||||
export function sanitizeNodeEntrypointEnv(env: NodeJS.ProcessEnv = process.env): void {
|
||||
delete env.ELECTRON_RUN_AS_NODE;
|
||||
delete env.ELECTRON_NO_ATTACH_CONSOLE;
|
||||
}
|
||||
|
||||
export async function main(): Promise<void> {
|
||||
const [argvMode, entryPath, ...args] = process.argv.slice(2);
|
||||
if (argvMode !== "bare" && argvMode !== "node-script") {
|
||||
@@ -18,7 +13,6 @@ export async function main(): Promise<void> {
|
||||
argvMode === "bare"
|
||||
? [process.argv[0] ?? "node", ...args]
|
||||
: [process.argv[0] ?? "node", entryPath, ...args];
|
||||
sanitizeNodeEntrypointEnv();
|
||||
await import(pathToFileURL(entryPath).href);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user