Skip to content
Browse files

Fix a bug in lein.bat when LEIN_DIR contains parens.

lein.bat would fail to run when installed into a folder whose path name
contains parentheses (such as "Program Files (x86)").
  • Loading branch information...
1 parent 95d8be5 commit 24b2403a4b767d531fbe2430edf42c0d4a01bf6a @mtyaka mtyaka committed Dec 18, 2010
Showing with 10 additions and 17 deletions.
  1. +10 −17 bin/lein.bat
View
27 bin/lein.bat
@@ -6,24 +6,17 @@ setLocal EnableDelayedExpansion
rem LEIN_JAR and LEIN_HOME variables can be set manually.
-if "x%LEIN_JAR%" == "x" (
- set LEIN_DIR=%~dp0
- set LEIN_JAR=!LEIN_DIR!leiningen-%LEIN_VERSION%-standalone.jar
-)
+if "x%LEIN_JAR%" == "x" set LEIN_JAR="%~dp0%leiningen-!LEIN_VERSION!-standalone.jar"
if "x%1" == "xself-install" goto SELF_INSTALL
if "x%1" == "xupgrade" goto NO_UPGRADE
-
-if "x%LEIN_HOME%" == "x" (
- set LEIN_HOME=%USERPROFILE%\.lein
-)
+if "x%LEIN_HOME%" == "x" set LEIN_HOME=%USERPROFILE%\.lein
set ORIGINAL_PWD=%CD%
call :FIND_DIR_CONTAINING_UPWARDS project.clj
if "%DIR_CONTAINING%" neq "" cd "%DIR_CONTAINING%"
-
set LEIN_PLUGINS="
for %%j in (".\lib\dev\*.jar") do (
set LEIN_PLUGINS=!LEIN_PLUGINS!;%%~fj
@@ -46,13 +39,13 @@ if exist "%~f0\..\..\src\leiningen\core.clj" (
for %%j in ("!LEIN_ROOT!\lib\*") do set LEIN_LIBS=!LEIN_LIBS!;%%~fj
set LEIN_LIBS=!LEIN_LIBS!"
- if "x!LEIN_LIBS!" == "x" if not exist "%LEIN_JAR%" goto NO_DEPENDENCIES
+ if "x!LEIN_LIBS!" == "x" if not exist %LEIN_JAR% goto NO_DEPENDENCIES
- set CLASSPATH=!LEIN_LIBS!;%CLASSPATH%;"!LEIN_ROOT!\src";"!LEIN_ROOT!\resources";"%LEIN_JAR%"
+ set CLASSPATH=!LEIN_LIBS!;%CLASSPATH%;"!LEIN_ROOT!\src";"!LEIN_ROOT!\resources";%LEIN_JAR%
) else (
rem Not running from a checkout.
- if not exist "%LEIN_JAR%" goto NO_LEIN_JAR
- set CLASSPATH="%LEIN_JAR%";%CLASSPATH%
+ if not exist %LEIN_JAR% goto NO_LEIN_JAR
+ set CLASSPATH=%LEIN_JAR%;%CLASSPATH%
)
if not "x%DEBUG%" == "x" echo CLASSPATH=%CLASSPATH%
@@ -75,7 +68,7 @@ goto RUN
:NO_LEIN_JAR
echo.
-echo "%LEIN_JAR%" can not be found.
+echo %LEIN_JAR% can not be found.
echo You can try running "lein self-install"
echo or change LEIN_JAR environment variable
echo or edit lein.bat to set appropriate LEIN_JAR path.
@@ -90,7 +83,7 @@ echo.
goto EOF
:SELF_INSTALL
-if exist "%LEIN_JAR%" (
+if exist %LEIN_JAR% (
echo %LEIN_JAR% already exists. Delete and retry.
goto EOF
)
@@ -102,9 +95,9 @@ if ERRORLEVEL 9009 (
set HTTP_CLIENT=curl --insecure -f -L -o
)
set LEIN_JAR_URL=https://github.com/downloads/technomancy/leiningen/leiningen-%LEIN_VERSION%-standalone.jar
-%HTTP_CLIENT% "%LEIN_JAR%" %LEIN_JAR_URL%
+%HTTP_CLIENT% %LEIN_JAR% %LEIN_JAR_URL%
if ERRORLEVEL 1 (
- del "%LEIN_JAR%">nul 2>&1
+ del %LEIN_JAR%>nul 2>&1
goto DOWNLOAD_FAILED
)
goto EOF

0 comments on commit 24b2403

Please sign in to comment.
Something went wrong with that request. Please try again.