fix: windows PATH setting for python configuration (#476)

fixes #474
This commit is contained in:
James M. Greene
2018-05-05 07:19:16 -05:00
committed by calebboyd
parent b91576973d
commit e65ce4df11
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -31,7 +31,7 @@ interface NexeHeader {
export class NexeCompiler<T extends NexeOptions = NexeOptions> {
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<T extends NexeOptions = NexeOptions> {
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
}
}