-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·37 lines (30 loc) · 1.07 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
#!/bin/bash
INFO="[INFO] BEEEGMOJIS: "
WARNING="[WARNING] BEEEGMOJIS: "
ERROR="[ERROR] BEEEGMOJIS: "
echo "${INFO}Making sure that NPM is installed"
if ! npm version > /dev/null; then
if [[ $OSTYPE == *"linux"* ]]; then
echo "${ERROR}NodeJS not found, please install it"
exit 4
elif [[ $OSTYPE == *"darwin"* ]]; then
read -p "${WARNING}NodeJS not found, is it alright to install it and if needed homebrew? [y/n] " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "${WARNING}Checking if Homebrew is installed"
if brew -v; then
echo "${INFO}Homebrew found"
else
echo "${WARNING}Homebrew not found, installing (you may have to rerun this script in a new terminal)"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
echo "${INFO}Installing NodeJS"
brew install node
fi
fi
fi
npm install
if [ -z "$1" ]; then
sudo node index.js -b
else
sudo node index.js $1
fi