diff --git a/setup/setup_vagrant.sh b/setup/setup_vagrant.sh index 8643c0bd..87806069 100644 --- a/setup/setup_vagrant.sh +++ b/setup/setup_vagrant.sh @@ -31,12 +31,17 @@ sudo apt-get install -y chrpath libssl1.0-dev libxft-dev && \ sudo apt-get install -y libfreetype6 libfreetype6-dev && \ sudo apt-get install -y libfontconfig1 libfontconfig1-dev -# Install Phantom JS -export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" && \ - wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2 && \ - tar xvjf $PHANTOM_JS.tar.bz2 && \ - sudo mv $PHANTOM_JS /usr/local/share && \ - sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin +# Install PhantomJS +echo 'Installing PhantomJS' +if [ ! -d /usr/local/bin/phantomjs/ ]; then + export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" && \ + wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2 && \ + tar xvjf $PHANTOM_JS.tar.bz2 && \ + sudo mv $PHANTOM_JS /usr/local/share && \ + sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin +else + echo 'PhantomJS is already installed and configured. skipping...' +fi # required packages declare -A packages