Using CasperJS as a Portable Installation?

后端 未结 2 1678
眼角桃花
眼角桃花 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.

    0 讨论(0)
  • 2021-01-16 03:02

    try it without call:

    phantomjs "%CASPER_BIN%bootstrap.js" --casper-path="%CASPER_PATH%" --cli %ARGV%
    
    0 讨论(0)
提交回复
热议问题