Using CasperJS as a Portable Installation?

后端 未结 2 1708
眼角桃花
眼角桃花 2021-01-16 02:25

I\'m trying to run CasperJS in a portable way that doesn\'t involve setting the path variable in Windows. Currently I have gotten this to partially work by moving the phanto

2条回答
  •  青春惊慌失措
    2021-01-16 02:56

    Got it to work. For the casperjs.bat file, put:

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

    Move the phantomjs.exe executable to the same directory as this batch file. Should work fine.

提交回复
热议问题