download-phantomjs.sh 610 B

1234567891011121314151617
  1. #!/bin/bash -e
  2. if [ ! -d '/tmp/phantomjs' ]; then
  3. _version="2.1.1"
  4. curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$_version-windows.zip > /tmp/phantomjs-win.zip
  5. curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$_version-macosx.zip > /tmp/phantomjs-mac.zip
  6. cd /tmp
  7. unzip /tmp/phantomjs-win.zip
  8. unzip /tmp/phantomjs-mac.zip
  9. mkdir -p /tmp/phantomjs/windows /tmp/phantomjs/darwin
  10. cp /tmp/phantomjs-$_version-windows/bin/phantomjs.exe /tmp/phantomjs/windows/phantomjs.exe
  11. cp /tmp/phantomjs-$_version-macosx/bin/phantomjs /tmp/phantomjs/darwin/phantomjs
  12. fi