-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·62 lines (54 loc) · 1.09 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
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
CMD=$(realpath "${0}")
CUR_DIR=$(dirname "${CMD}")
# shellcheck disable=SC1090
source "${CUR_DIR}"/scripts/utils.sh
# Set local timezone
export TZ="Asia/Kolkata"
# Setup build environment: {{{
echo "Setting up git..."
bash "${CUR_DIR}"/scripts/setup_git.sh
# }}}
# Install rust: {{{
if ! command -v rustup &>/dev/null; then
echo "Setting up rust..."
bash "${CUR_DIR}"/scripts/setup_rust.sh
fi
# }}}
usage() {
echo "Usage: ${0} [OPTIONS]"
echo "Options:"
echo " arch: setup Arch Linux"
echo " ubuntu: setup Ubuntu"
echo " help: show this help message"
}
if echo "${@}" | grep -wqE "help|-h"; then
if [ -n "${2}" ] && [ "$(type -t usage"${2}")" == function ]; then
echo "--- ${2} Setup Commands ---"
eval usage "${2}"
else
usage
fi
exit 0
fi
OPTIONS=("${@}")
for option in "${OPTIONS[@]}"; do
echo "processing option: $option"
case ${option} in
*arch)
echo "Setting up Arch..."
./setup-arch.sh
;;
*ubuntu | *debian)
echo "Setting up Ubuntu/Debian..."
./setup-linux.sh
;;
help | -h)
usage
;;
*)
echo "unknown option: $option"
usage
;;
esac
done