-
Notifications
You must be signed in to change notification settings - Fork 7
/
quickstart.command
executable file
·87 lines (68 loc) · 3.45 KB
/
quickstart.command
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
# To use the remote install script, run:
# > curl -s https://raw.githubusercontent.com/InitialState/node-hub/master/quickstart.command | sh -s 8080 my_access_key
# If your environment already has node installed, you can clone this repo and run `npm start -- 8080 my_access_key`
# SETUP
echo " "
echo " •●●●●●●●●• "
echo " •●●●●●●●●●●●●●●• "
echo " ●●●●●●●●●●●●●●●●●●• "
echo " ●●●●●●●●●●●●●●●●●●●●●• "
echo " ●●●●●●●●• •●●●●●●●• "
echo " ●●●●●●● ●●●●●●●● ●●●●●●● "
echo " ●●●●●●● •●●●●●●●• ●●●●●●● "
echo " ●●●●●●● •●●●●●●●• ●●●●●●● "
echo " ●●●●●●● ●●●●●●●● ●●●●●●● "
echo " "
echo " ●●●●●●● •●●●●●●●● ●●●●●●● "
echo " ●●●●●●● •●●●●●●●● ●●●●●●● "
echo " ●●●●●●● ●●●●●●●●• ●●●●●●● "
echo " ●●●●●●● ●●●●●●●● ●●●●●●● "
echo " •●●●●●●●• •●●●●●●●● "
echo " •●●●●●●●●●●●●●●●●●●●●● "
echo " •●●●●●●●●●●●●●●●●●● "
echo " •●●●●●●●●●●●●●●• "
echo " •●●●●●●●●• "
echo " "
echo " "
echo "Beginning node-hub quick start..."
# ensure that node is installed
if hash node 2>/dev/null; then
echo "Node.js Pre-Installed"
else
echo "Node.js Not Found"
if hash nvm 2>/dev/null; then
echo "NVM Pre-Installed"
else
echo "Installing NVM"
# install NVM
curl -s https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh
# initialize nvm
export NVM_DIR=$(echo ~/.nvm)
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
echo "NVM Installed (NVM_DIR: $NVM_DIR)"
fi;
echo "Installing Node.js"
# install Node
nvm install v5
echo "Node.js Installed"
fi;
# ensure that the node-hub repo is available
if [ -d .git ]; then
# Do nothing with an existing repo
echo "Existing .git repository found";
else
# Clone Hub Source
echo "Cloning .git repository";
git clone https://github.com/InitialState/node-hub.git
# Move into the node-hub source root
cd node-hub
fi;
# Set Initial State access key
export IS_API_ACCESS_KEY="place_access_key_here"
echo Installing Node Dependencies
# Install hub dependencies
npm install
echo Starting Node
# START HUB
npm start -- $1 $2