Skip to content

Commit

Permalink
setup_vagrant.sh: Idempotentialize PhantomJS config
Browse files Browse the repository at this point in the history
Only try to install and configure PhantomJS
if there is no phantomjs directory in /usr/local/bin.
  • Loading branch information
DeeDeeG committed Oct 5, 2018
1 parent f54773c commit 2269ce0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions setup/setup_vagrant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2269ce0

Please sign in to comment.