-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathinstall
More file actions
executable file
·60 lines (51 loc) · 1.12 KB
/
Copy pathinstall
File metadata and controls
executable file
·60 lines (51 loc) · 1.12 KB
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
#!/usr/bin/env bash
SCRIPTSDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts"
# shellcheck source=scripts/_common-setup.sh
source "$SCRIPTSDIR/_common-setup.sh"
if [ "$EUID" == "0" ]; then
die "Please do not run this script as root"
fi
UPDATE=false
SHOW_HELP=false
VERBOSE=false
while [[ $# -gt 0 ]]; do
case "$1" in
--update | -u)
UPDATE=true
shift
;;
--help | -h)
SHOW_HELP=true
break
;;
--verbose)
VERBOSE=true
shift
;;
*)
shift
;;
esac
done
eval set -- "$PARSED_ARGS"
if $SHOW_HELP; then
cat <<EOF
Dotfiles installer.
Usage:
$(readlink -f "$0") [flags]
Flags:
-c, --clean Will clean installed packages.
-u, --update Will download and install/reinstall even if the tools are already installed
--verbose Show verbose output
--gh <user:pw> GitHub username and password
-h, --help This help
EOF
exit 0
fi
if $VERBOSE; then
writeGreen "Running $(basename "$0") $ALL_ARGS"
writeGreen " Update is $UPDATE"
fi
sudo -E "$SCRIPTSDIR"/pre-install.sh "$@"
"$SCRIPTSDIR"/install.sh "$@"
echo Done.