Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
launcher: Fix server not starting on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
elisee committed Dec 10, 2015
1 parent 85ba5fc commit c1ecae9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion launcher/src/myServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ function startServer() {
let serverPath = path.join(path.resolve(path.dirname(nodeProcess.mainModule.filename)), "../../server/index.js");

let serverEnv: { [key: string]: string; } = {};
serverEnv["ELECTRON_RUN_AS_NODE"] = "1";
serverEnv["ELECTRON_NO_ATTACH_CONSOLE"] = "1";

// NOTE: It would be nice to simply copy all environment variables
// but somehow, this prevents Electron 0.35.1 from starting the server
// for (let key in nodeProcess.env) serverEnv[key] = nodeProcess.env[key];

// So instead, we'll just copy the environment variables we definitely need
serverEnv["ATOM_SHELL_INTERNAL_RUN_AS_NODE"] = "1";
if (nodeProcess.env["NODE_ENV"] != null) serverEnv["NODE_ENV"] = nodeProcess.env["NODE_ENV"];
if (nodeProcess.env["APPDATA"] != null) serverEnv["APPDATA"] = nodeProcess.env["APPDATA"];
if (nodeProcess.env["HOME"] != null) serverEnv["HOME"] = nodeProcess.env["HOME"];
Expand Down

0 comments on commit c1ecae9

Please sign in to comment.