From 089aa02a8208907db0a4145715896a72383197e1 Mon Sep 17 00:00:00 2001 From: calebboyd Date: Fri, 1 Jun 2018 21:37:08 -0500 Subject: [PATCH] fix: always assign env --- package.json | 2 +- src/compiler.ts | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 538434f..eda1500 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.28", + "version": "2.0.0-rc.29", "contributors": [ "Craig Condon (http://crcn.io)", "Jared Allard ", diff --git a/src/compiler.ts b/src/compiler.ts index 04cfebe..224b12f 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -56,18 +56,18 @@ export class NexeCompiler { ? join(this.src, 'Release', 'node.exe') : join(this.src, 'out', 'Release', 'node') this.log.step('nexe ' + version, 'info') - if (python) { - if (isWindows) { - // Do a little shuffling to correctly set the PATH regardless of property name case sensitivity - const originalPath = process.env.PATH - delete process.env.PATH - this.env = { ...process.env } - this.env.PATH = dequote(normalize(python)) + delimiter + originalPath - process.env.PATH = originalPath - } else { - this.env = { ...process.env } - this.env.PYTHON = python - } + + if (isWindows) { + const originalPath = process.env.PATH + delete process.env.PATH + this.env = { ...process.env } + this.env.PATH = python + ? (this.env.PATH = dequote(normalize(python)) + delimiter + originalPath) + : originalPath + process.env.PATH = originalPath + } else { + this.env = { ...process.env } + python && (this.env.PYTHON = python) } }