Browse files

Fixed bugs when using spaces in the path

  • Loading branch information...
1 parent 2dd1e7e commit e3953a073825c00854ac81a3c5c3218fe86f8b28 @ctasada committed Nov 26, 2012
View
17 bin/run-class.bat
@@ -16,20 +16,21 @@ REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
-set Count=0
-for %%a in (%*) do set /a Count+=1
-if %Count% geq 1 goto :continue
+set argC=0
+for %%a in (%*) do set /a argC+=1
+if %argC% geq 1 goto :continue
echo %0 java-class-name [options]
goto :eof
:continue
SET BASE_DIR=%~dp0..
SET CLASSPATH=.
-for %%j in (%BASE_DIR%\lib\*.jar) do (call :append_classpath "%%j")
-for %%j in (%BASE_DIR%\contrib\*\lib\*.jar) do (call :append_classpath "%%j")
-for %%j in (%BASE_DIR%\dist\*.jar) do (call :append_classpath "%%j")
-set CLASSPATH=%CLASSPATH%;%BASE_DIR%\dist\resources
+set VOLDEMORT_CONFIG_DIR=%1%/config
+
+for %%j in ("%BASE_DIR%\dist\*.jar") do (call :append_classpath "%%j")
+for %%j in ("%BASE_DIR%\lib\*.jar") do (call :append_classpath "%%j")
+set CLASSPATH=%CLASSPATH%;"%BASE_DIR%\dist\resources"
goto :run
:append_classpath
@@ -38,7 +39,7 @@ goto :eof
:run
if "%VOLD_OPTS%" == "" set "VOLD_OPTS=-Xmx2G -server -Dcom.sun.management.jmxremote"
-java -Dlog4j.configuration=%BASE_DIR%\src\java\log4j.properties %VOLD_OPTS% -cp %CLASSPATH% %*
+java -Dlog4j.configuration=%VOLDEMORT_CONFIG_DIR%\log4j.properties %VOLD_OPTS% -cp %CLASSPATH% %*
endlocal
:eof
View
2 bin/voldemort-admin-tool.bat
@@ -18,4 +18,4 @@ REM
SET BASE_DIR=%~dp0..
-call %BASE_DIR%/bin/run-class.bat voldemort.VoldemortAdminTool %*
+call "%BASE_DIR%/bin/run-class.bat" voldemort.VoldemortAdminTool %*
View
2 bin/voldemort-performance-tool.bat
@@ -18,4 +18,4 @@ REM
SET BASE_DIR=%~dp0..
-call %BASE_DIR%/bin/run-class.bat voldemort.performance.benchmark.Benchmark %*
+call "%BASE_DIR%/bin/run-class.bat" voldemort.performance.benchmark.Benchmark %*
View
2 bin/voldemort-rebalance.bat
@@ -18,4 +18,4 @@ REM
SET BASE_DIR=%~dp0..
-%BASE_DIR%/bin/run-class.bat voldemort.client.rebalance.RebalanceCLI %*
+call "%BASE_DIR%/bin/run-class.bat" voldemort.client.rebalance.RebalanceCLI %*
View
20 bin/voldemort-server.bat
@@ -16,10 +16,10 @@ REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
-set Count=0
-for %%a in (%*) do set /a Count+=1
-if %Count% geq 2 goto :continue
-echo USAGE: bin/voldemort-server.bat [voldemort_home] [voldemort_config_dir]
+set argC=0
+for %%a in (%*) do set /a argC+=1
+if %argC% leq 2 goto :continue
+echo USAGE: bin/voldemort-server.bat [voldemort_home_dir] [voldemort_config_dir]
goto :eof
:continue
@@ -28,10 +28,12 @@ setlocal
SET BASE_DIR=%~dp0..
SET CLASSPATH=.
-for %%j in (%BASE_DIR%\lib\*.jar) do (call :append_classpath "%%j")
-for %%j in (%BASE_DIR%\contrib\*\lib\*.jar) do (call :append_classpath "%%j")
-for %%j in (%BASE_DIR%\dist\*.jar) do (call :append_classpath "%%j")
-set CLASSPATH=%CLASSPATH%:%BASE_DIR%\dist\resources
+set VOLDEMORT_CONFIG_DIR=%1%/config
+rem call %VOLDEMORT_CONFIG_DIR%/voldemort-env.bat
+
+for %%j in ("%BASE_DIR%\dist\*.jar") do (call :append_classpath "%%j")
+for %%j in ("%BASE_DIR%\lib\*.jar") do (call :append_classpath "%%j")
+set CLASSPATH=%CLASSPATH%:"%BASE_DIR%\dist\resources"
goto :run
:append_classpath
@@ -40,7 +42,7 @@ goto :eof
:run
if "%VOLD_OPTS%" == "" set "VOLD_OPTS=-Xmx2G -server -Dcom.sun.management.jmxremote"
-java -Dlog4j.configuration=src/java/log4j.properties %VOLD_OPTS% -cp %CLASSPATH% voldemort.server.VoldemortServer %*
+java %VOLD_OPTS% -cp %CLASSPATH% voldemort.server.VoldemortServer %*
endlocal
:eof
View
9 bin/voldemort-shell.bat
@@ -16,17 +16,18 @@ REM See the License for the specific language governing permissions and
REM limitations under the License.
REM
-set Count=0
-for %%a in (%*) do set /a Count+=1
-if %Count% geq 2 goto :continue
+set argC=0
+for %%a in (%*) do set /a argC+=1
+if %argC% geq 2 goto :continue
echo "USAGE: bin/voldemort-shell.bat store_name bootstrap_url [command_file] [--client-zone-id <zone-id>]"
goto :eof
:continue
setlocal
SET BASE_DIR=%~dp0..
-%BASE_DIR%\bin\run-class.bat jline.ConsoleRunner voldemort.VoldemortClientShell %*
+call "%BASE_DIR%\bin\run-class.bat" jline.ConsoleRunner voldemort.VoldemortClientShell %*
endlocal
+
:eof

0 comments on commit e3953a0

Please sign in to comment.