-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.sh
executable file
·40 lines (31 loc) · 1.11 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
set -e
# set -x # Uncomment for debug
MY_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd ${MY_DIR}
if [ -z $(command -v curl) ]; then
echo "Please ensure the command line utility curl is installed and try again" && exit 1
fi
if [ -z $(command -v ruby) ]; then
echo "Please ensure ruby is installed and try again" && exit 1
fi
if (uname | grep -q Darwin) && [ -z $( command -v brew ) ]; then
echo "Installing brew..."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
if [ -z $(command -v inkscape) ]; then
echo "Installing inkscape..."
if (uname | grep -q Darwin); then
((brew --version > /dev/null) && (brew tap caskroom/cask > /dev/null) && (brew cask install xquartz inkscape))
else
((apt-get --version > /dev/null) && (apt-get install -y inkscape))
fi
fi
if [ -z $(command -v bundle) ]; then
gem install bundler:2.2.31
fi
bundle install
if [ ! -f "${MY_DIR}/.env" ]; then
echo "Creating standard .env file. Please ensure the values in that file make sense before continuing..."
cp "${MY_DIR}/.env{.example,}"
fi