Skip to content

Commit

Permalink
Let aws.cmd find python.exe on paths with spaces.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joeyespo committed Jun 25, 2014
1 parent cbf4ebc commit ef66982
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bin/aws.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo OFF
REM="""
setlocal
set PythonExe=
set PythonExe=""
set PythonExeFlags=

for %%i in (cmd bat exe) do (
Expand All @@ -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
Expand Down

0 comments on commit ef66982

Please sign in to comment.