fix: case-sensitive windows PATH setting for python configuration (#481)

fixes #474
amends #476

related to nodejs/node#20605
This commit is contained in:
James M. Greene
2018-05-08 13:47:16 -05:00
committed by Caleb Boyd
parent e65ce4df11
commit 24c0b6be76
+3 -2
View File
@@ -1,4 +1,4 @@
import { dirname, normalize, join } from 'path'
import { delimiter, dirname, normalize, join } from 'path'
import { Buffer } from 'buffer'
import { createHash } from 'crypto'
import { createReadStream } from 'fs'
@@ -60,8 +60,9 @@ export class NexeCompiler<T extends NexeOptions = NexeOptions> {
if (isWindows) {
// 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
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 }