refs #269 - Fixing unsupported spaces in path and argument splitting
Showing
1 changed file
with
17 additions
and
11 deletions
1 | @ECHO OFF | 1 | @ECHO OFF |
2 | set CASPER_PATH=%~dp0..\ | 2 | @setlocal EnableDelayedExpansion |
3 | set CASPER_BIN=%CASPER_PATH%bin\ | 3 | set CASPER_PATH=%~dp0.. |
4 | set CASPER_BIN=%CASPER_PATH%\bin\ | ||
4 | 5 | ||
5 | set PHANTOMJS_NATIVE_ARGS=(--cookies-file --config --debug --disk-cache --ignore-ssl-errors --load-images --load-plugins --local-storage-path --local-storage-quota --local-to-remote-url-access --max-disk-cache-size --output-encoding --proxy --proxy-auth --proxy-type --remote-debugger-port --remote-debugger-autorun --script-encoding --web-security) | 6 | set PHANTOMJS_NATIVE_ARGS=(--cookies-file --config --debug --disk-cache --ignore-ssl-errors --load-images --load-plugins --local-storage-path --local-storage-quota --local-to-remote-url-access --max-disk-cache-size --output-encoding --proxy --proxy-auth --proxy-type --remote-debugger-port --remote-debugger-autorun --script-encoding --web-security) |
6 | 7 | ||
7 | set PHANTOM_ARGS= | 8 | set PHANTOM_ARGS= |
8 | set CASPER_ARGS= | 9 | set CASPER_ARGS= |
9 | 10 | ||
10 | :Loop | 11 | set ARGV=%* |
11 | if "%1"=="" goto Continue | 12 | for %%a in ("%ARGV: =" "%") do ( |
12 | set IS_PHANTOM_ARG=0 | 13 | set IS_PHANTOM_ARG=0 |
14 | set arg=%%~a | ||
13 | for %%i in %PHANTOMJS_NATIVE_ARGS% do ( | 15 | for %%i in %PHANTOMJS_NATIVE_ARGS% do ( |
14 | if "%%i"=="%1" set IS_PHANTOM_ARG=1 | 16 | for %%x in (!arg!) do ( |
17 | if "%%x"=="%%i" ( | ||
18 | set IS_PHANTOM_ARG=1 | ||
19 | goto :EndOfCheck | ||
15 | ) | 20 | ) |
16 | if %IS_PHANTOM_ARG%==0 set CASPER_ARGS=%CASPER_ARGS% %1 | 21 | ) |
17 | if %IS_PHANTOM_ARG%==1 set PHANTOM_ARGS=%PHANTOM_ARGS% %1 | 22 | ) |
18 | shift | 23 | :EndOfCheck |
19 | goto Loop | 24 | if !IS_PHANTOM_ARG!==0 set CASPER_ARGS=!CASPER_ARGS! !arg! |
20 | :Continue | 25 | if !IS_PHANTOM_ARG!==1 set PHANTOM_ARGS=!PHANTOM_ARGS! !arg! |
26 | ) | ||
21 | 27 | ||
22 | call phantomjs%PHANTOM_ARGS% %CASPER_BIN%bootstrap.js --casper-path=%CASPER_PATH% --cli%CASPER_ARGS% | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
28 | call phantomjs%PHANTOM_ARGS% "%CASPER_BIN%bootstrap.js" --casper-path="%CASPER_PATH%" --cli%CASPER_ARGS% | ||
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment