-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfuselage.sh
executable file
·79 lines (63 loc) · 1.35 KB
/
fuselage.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
if [[ $1 == "--help" || $1 == "-h" ]]; then
echo "Usage: fuselage.sh -a link|undo -p fuselage;fuselage-icons"
exit 1
fi
while getopts ":a:p:" opt; do
case $opt in
a) action="$OPTARG"
;;
p) packages="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
exit 1
;;
esac
case $OPTARG in
-*) echo "Option $opt needs a valid argument"
exit 1
;;
esac
done
echo "action: $action"
action="${action:-link}"
packages="${packages:-fuselage}"
if [[ $action != "link" && $action != "undo" ]]; then
echo "Invalid action"
exit 1
fi
if [[ $action != "undo" ]]; then
echo "linking local project"
else
echo "unlinking local project"
fi
cd ./node_modules/@rocket.chat
for i in $(echo $packages | tr ";" "\n")
do
rm -rf $i
if [[ $action != "undo" ]]; then
ln -s "../../../fuselage/packages/$i" $i
echo "root $i"
fi
done
cd ../..
cd ./apps/meteor/node_modules/@rocket.chat
for i in $(echo $packages | tr ";" "\n")
do
rm -rf $i
if [[ $action != "undo" ]]; then
rm -rf $i
fi
done
if [[ $action != "undo" ]]; then
echo "linking local project"
for i in $(echo $packages | tr ";" "\n")
do
ln -s "../../../../../fuselage/packages/$i" $i
echo "apps/meteor $i"
done
fi
cd ../../../../
if [[ $action == "undo" ]]; then
yarn
fi