Merge pull request #1062 from UziTech/patch-1

check for env.path case-insensitive in windows
This commit is contained in:
Glavin Wiechert 2016-07-13 13:51:26 -03:00 committed by GitHub
commit b4cb42adb7
1 changed files with 8 additions and 0 deletions

View File

@ -170,6 +170,14 @@ module.exports = class Beautifier
new Promise((resolve, reject) => new Promise((resolve, reject) =>
options.path ?= env.PATH options.path ?= env.PATH
if @isWindows if @isWindows
# Environment variables are case-insensitive in windows
# Check env for a case-insensitive 'path' variable
if !options.path
for i of env
if i.toLowerCase() is "path"
options.path = env[i]
break
# Trick node-which into including files # Trick node-which into including files
# with no extension as executables. # with no extension as executables.
# Put empty extension last to allow for other real extensions first # Put empty extension last to allow for other real extensions first