fix: always assign env

This commit is contained in:
calebboyd
2018-06-01 21:37:08 -05:00
parent 92fa19cba6
commit 089aa02a82
2 changed files with 13 additions and 13 deletions
+1 -1
View File
@@ -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 <craig.j.condon@gmail.com> (http://crcn.io)",
"Jared Allard <jaredallard@outlook.com>",
+12 -12
View File
@@ -56,18 +56,18 @@ export class NexeCompiler<T extends NexeOptions = NexeOptions> {
? 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)
}
}