generated from anishathalye/dotfiles_template
-
Notifications
You must be signed in to change notification settings - Fork 8
/
install
executable file
·73 lines (62 loc) · 1.41 KB
/
install
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
#!/usr/bin/env bash
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$BASEDIR"/_common-setup.sh
if [ "$EUID" == "0" ]; then
die "Please do not run this script as root"
fi
SKIP_POST_INSTALL=false
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
;;
--skip-post-install|-s)
SKIP_POST_INSTALL=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
--skip-post-install Will skip post install steps (installation of packages etc)
--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"
writeGreen " Skip post install is $SKIP_POST_INSTALL"
fi
pushd "${BASEDIR}" > /dev/null
sudo -E "$BASEDIR"/pre-install.sh "$@"
"$BASEDIR"/install.sh "$@"
if ! $SKIP_POST_INSTALL; then
"$BASEDIR"/post-install.sh "$@"
fi
popd > /dev/null
echo Done.