Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
Merge pull request #270 from langholz/win-batch-path-and-args-fix
Browse files Browse the repository at this point in the history
refs #269 - Fixing unsupported spaces in path and argument splitting
  • Loading branch information
n1k0 committed Dec 10, 2012
2 parents a8c70c7 + 03af960 commit 0d659f1
Showing 1 changed file with 4 additions and 21 deletions.
25 changes: 4 additions & 21 deletions batchbin/casperjs.bat
@@ -1,22 +1,5 @@
@ECHO OFF
set CASPER_PATH=%~dp0..\
set CASPER_BIN=%CASPER_PATH%bin\

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)

set PHANTOM_ARGS=
set CASPER_ARGS=

:Loop
if "%1"=="" goto Continue
set IS_PHANTOM_ARG=0
for %%i in %PHANTOMJS_NATIVE_ARGS% do (
if "%%i"=="%1" set IS_PHANTOM_ARG=1
)
if %IS_PHANTOM_ARG%==0 set CASPER_ARGS=%CASPER_ARGS% %1
if %IS_PHANTOM_ARG%==1 set PHANTOM_ARGS=%PHANTOM_ARGS% %1
shift
goto Loop
:Continue

call phantomjs%PHANTOM_ARGS% %CASPER_BIN%bootstrap.js --casper-path=%CASPER_PATH% --cli%CASPER_ARGS%
set CASPER_PATH=%~dp0..
set CASPER_BIN=%CASPER_PATH%\bin\
set ARGV=%*
call phantomjs "%CASPER_BIN%bootstrap.js" --casper-path="%CASPER_PATH%" --cli %ARGV%

0 comments on commit 0d659f1

Please sign in to comment.