-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathupdate-micros.sh
executable file
·63 lines (53 loc) · 1.38 KB
/
update-micros.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
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Colors
Black='\033[0;30m' # Black
BRed='\033[1;31m' # Red
BGreen='\033[1;32m' # Green
BYellow='\033[1;33m' # Yellow
BBlue='\033[1;34m' # Blue
BPurple='\033[1;35m' # Purple
BCyan='\033[1;36m' # Cyan
opArg="${1}"
arg="${2}"
echo Argument $arg1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo -e "$BGreen Working directory: $DIR\n"
echo -e "$Black"
micros=(circles comments gallery posts user-rels vang votes)
# Update telar-core module
update_telar_core(){
for i in "${micros[@]}";
do
echo -e "$BYellow"
microPath="$DIR/micros/$i"
echo "Updating [telar-core] module in $microPath"
cd "$microPath" && go get github.com/red-gold/[email protected] && go mod tidy
echo "[telar-core] module updated for $i"
done
echo -e "$Black"
}
# Update ts-serverless module
update_ts_serverless(){
for i in "${micros[@]}";
do
echo -e "$BYellow"
microPath="$DIR/micros/$i"
echo "Updating [ts-serverless] module in $microPath"
cd "$microPath" && go get github.com/red-gold/[email protected] && go mod tidy
echo "[ts-serverless] module updated for $i"
done
echo -e "$Black"
}
case $opArg in
telar-core)
echo -n "Updating [telar-core] module ..."
update_telar_core
;;
ts-serverless)
echo -n "Updating [ts-serverless] module"
update_ts_serverless
;;
*)
echo -n "unknown"
;;
esac