-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_all.sh
executable file
·68 lines (58 loc) · 1.31 KB
/
install_all.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
# declare common variables we will use later
version=""
ersion="" # without the v lol
_get_machine_info
app_table=(yq gh shfmt)
export DEPENDENCIES=(yq)
# app source url/repo artifact-format
yq=("github" "mikefarah/yq" 'yq_${KERNEL}_${ARCH_AMD}')
gh=("github" "cli/cli" 'gh_${ersion}_${KERNEL}_${ARCH_x64}.tar.gz')
shfmt=("github" "mvdan/sh" 'shfmt_${version}_${KERNEL}_${ARCH_AMD}')
SHORT_OPTS="h"
LONG_OPTS="help,install-dependencies,prefix:"
ARGS=$(getopt -o "$SHORT_OPTS" --long "$LONG_OPTS" -n "$(basename $0)" -- "$@")
if [ $? -ne 0 ]; then
print "Unable to parse options... ttyl"
exit 1
fi
eval set -- "$ARGS"
PREFIX="$HOME/.local"
INSTALL_DEPENDENCIES="false"
HELP="false"
INSTALL="false"
while true; do
case "$1" in
--install-dependencies)
INSTALL_DEPENDENCIES=true
shift
;;
--prefix)
# PREFIX="$2"
PREFIX="$PWD" # for testing
shift 2
;;
-h | --help)
HELP=true
shift
;;
--)
shift
break
;;
install)
INSTALL=true
shift
break
;;
*)
echo "Internal error!"
exit 1
;;
esac
done
if [ "$INSTALL_DEPENDENCIES" = true ]; then install_dependencies; fi
main() {
echo "Installing dependencies"
}
. install_all.func.sh
main