forked from chili-epfl/FROG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitial_setup.sh
More file actions
executable file
·31 lines (26 loc) · 878 Bytes
/
initial_setup.sh
File metadata and controls
executable file
·31 lines (26 loc) · 878 Bytes
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
#!/bin/bash
if [ -d "frog/node_modules" ]; then
echo "Please run git clean -fdx before running initial_setup.sh"
exit 0
fi
shopt -s dotglob
FROG="`pwd`"
YARN_VERSION='1.12.1'
if which yarn && [[ `yarn --version` == $YARN_VERSION ]]; then
echo 'Using pre-installed global Yarn'; YARN=yarn
else
if [ -f "$FROG/node_modules/.bin/yarn" ] && [[ `"$FROG/node_modules/.bin/yarn" --version` == $YARN_VERSION ]]; then
echo 'Using pre-installed local Yarn'; YARN="$FROG/node_modules/.bin/yarn"
else
echo 'Installing Yarn'; npm install yarn@$YARN_VERSION && YARN="$FROG/node_modules/.bin/yarn"
fi
fi
echo "Yarn: $YARN"
"$YARN" install
rm -rf frog/node_modules
ln -s `pwd`/node_modules frog
node linkFiles.js
echo
echo -e "\xE2\x9C\xA8 Finished Initial Setup."
echo -e "\xF0\x9F\xA4\x93 Run ${LBLUE}npm start server ${NC}to begin hacking!"
exit 0