From ef669820d8ecbbe5451f24134e8f2d504e512871 Mon Sep 17 00:00:00 2001 From: Joe Esposito Date: Wed, 25 Jun 2014 01:04:04 -0400 Subject: [PATCH] Let aws.cmd find python.exe on paths with spaces. Before this commit, you'd get a vague "\Python\python.exe was unexpected at this time." message when Python is installed in "C:\Program Files (x86)\Python". This fix always surrounds the PythonExe variable's value with quotes so `if [%PythonExe%]==[""]` doesn't break. --- bin/aws.cmd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/aws.cmd b/bin/aws.cmd index e9ff63974307..9baf5302b4dd 100644 --- a/bin/aws.cmd +++ b/bin/aws.cmd @@ -1,7 +1,7 @@ @echo OFF REM=""" setlocal -set PythonExe= +set PythonExe="" set PythonExeFlags= for %%i in (cmd bat exe) do ( @@ -16,13 +16,13 @@ for /f "tokens=2 delims==" %%i in ('assoc .py') do ( ) ) ) -"%PythonExe%" -x %PythonExeFlags% "%~f0" %* +%PythonExe% -x %PythonExeFlags% "%~f0" %* goto :EOF :SetPythonExe -if not [%1]==[""] ( - if ["%PythonExe%"]==[""] ( - set PythonExe=%~1 +if not ["%~1"]==[""] ( + if [%PythonExe%]==[""] ( + set PythonExe="%~1" ) ) goto :EOF