-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·52 lines (44 loc) · 1.02 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
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# Usage
# - install packages: $ ./setup.sh
# - install packages and serve the app: $ ./setup.sh -s
# - install packages and link rms-sparklines: $ ./setup.sh -l
# - install packages, link rms-sparklines, and serve the app: $ ./setup.sh -ls
# Process script arguments and set control variables
#
link="no"
serve="no"
echo "Process script arguments and set control variables"
while getopts "ls" flag
do
echo "$flag" $OPTIND $OPTARG
if [ $flag = "l" ];
then
link="yes"
fi
if [ $flag = "s" ];
then
serve="yes"
fi
done
# echo "link is: $link"
# echo "serve is: $serve"
# Set up the Angular Application
#
echo "Reset Angular application packages"
rm -rf node_modules
npm install --ignore-scripts
if [ $link = "yes" ];
then
echo "Linking rms-sparkline"
npm link ../rms-sparklines/
else
echo "We WILL NOT link rms-sparkline"
fi
if [ $serve = "yes" ];
then
echo "Serving rms-sparkline-styleguide"
ng serve
else
echo "We WILL NOT serve rms-sparkline-styleguide"
fi