From a4474e59db658cea570c78254fa71119cf688db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jukka=20Jyl=C3=A4nki?= Date: Wed, 9 May 2018 09:55:19 +0300 Subject: [PATCH] Improve emsdk on MSYS2. --- emsdk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emsdk b/emsdk index 15c2277..d203c1d 100755 --- a/emsdk +++ b/emsdk @@ -34,7 +34,7 @@ VERBOSE = bool(os.getenv('EMSDK_VERBOSE')) if os.getenv('EMSDK_VERBOSE') != None POWERSHELL = bool(os.getenv('EMSDK_POWERSHELL')) WINDOWS = False -if os.name == 'nt' or (os.getenv('SYSTEMROOT') != None and 'WINDOWS' in os.getenv('SYSTEMROOT')) or (os.getenv('COMSPEC') != None and 'WINDOWS' in os.getenv('COMSPEC')): +if os.name == 'nt' or (os.getenv('SYSTEMROOT') != None and 'windows' in os.getenv('SYSTEMROOT').lower()) or (os.getenv('COMSPEC') != None and 'windows' in os.getenv('COMSPEC').lower()): WINDOWS = True ENVPATH_SEPARATOR = ';' @@ -86,7 +86,7 @@ EMSDK_SET_ENV = 'emsdk_set_env.ps1' if POWERSHELL else 'emsdk_set_env.bat' if (W # Finds the given executable 'program' in PATH. Operates like the Unix tool 'which'. def which(program): def is_exe(fpath): - return os.path.isfile(fpath) and os.access(fpath, os.X_OK) + return os.path.isfile(fpath) and (WINDOWS or os.access(fpath, os.X_OK)) fpath, fname = os.path.split(program) if fpath: