From e65ce4df11d12fa02f346da3ae174fad929c003b Mon Sep 17 00:00:00 2001 From: "James M. Greene" Date: Sat, 5 May 2018 07:19:16 -0500 Subject: [PATCH] fix: windows PATH setting for python configuration (#476) fixes #474 --- package.json | 2 +- src/compiler.ts | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index bf2a348..c9df3cc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nexe", "description": "Create a single executable out of your Node.js application", "license": "MIT", - "version": "2.0.0-rc.26", + "version": "2.0.0-rc.27", "contributors": [ "Craig Condon (http://crcn.io)", "Jared Allard ", diff --git a/src/compiler.ts b/src/compiler.ts index d3d717e..82d3a1c 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -31,7 +31,7 @@ interface NexeHeader { export class NexeCompiler { private start = Date.now() - private env = { ...process.env } + private env: any private compileStep: LogStep public log = new Logger(this.options.loglevel) public src: string @@ -58,8 +58,13 @@ export class NexeCompiler { this.log.step('nexe ' + version, 'info') if (python) { if (isWindows) { - this.env.PATH = '"' + dequote(normalize(python)) + '";' + this.env.PATH + // Do a little shuffling to correctly set the PATH regardless of property name case sensitivity + const originalPath = process.env.PATH + process.env.PATH = dequote(normalize(python)) + ';' + originalPath + this.env = { ...process.env } + process.env.PATH = originalPath } else { + this.env = { ...process.env } this.env.PYTHON = python } }