-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.sh
More file actions
64 lines (56 loc) · 859 Bytes
/
common.sh
File metadata and controls
64 lines (56 loc) · 859 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
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
#!/usr/bin/bash
ALL=0
CORE=0
DEV=0
EXTRA=0
WORKSTATION=0
SYSTEM=0
if [[ -n "$DISPLAY" ]] && command -v meld &> /dev/null;
then
merge_cmd=(meld)
else
merge_cmd=(vim -d)
fi
if [[ "$#" -eq 0 ]]; then
ALL=1
fi
options=$(getopt -o acdew -l all,core,dev,extra,workstation -- "$@")
[ $? -eq 0 ] || {
echo "Incorrect options provided"
exit 1
}
eval set -- "$options"
while true; do
case "$1" in
-a | --all)
ALL=1
;;
-c | --core)
CORE=1
;;
-d | --dev)
DEV=1
;;
-e | --extra)
EXTRA=1
;;
-w | --workstation)
WORKSTATION=1
;;
-s | --system)
SYSTEM=1
;;
--)
shift
break
;;
esac
shift
done
if [ "${ALL}" -eq 1 ]; then
CORE=1
WORKSTATION=1
EXTRA=1
DEV=1
SYSTEM=1
fi