generated from anishathalye/dotfiles_template
-
Notifications
You must be signed in to change notification settings - Fork 8
/
post-install.sh
executable file
·61 lines (52 loc) · 1.35 KB
/
post-install.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
#!/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 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
Installs everything after dotbot initial setup.
Usage:
`readlink -f "$0"` [flags]
Flags:
-u, --update Will download and install/reinstall even if the tools are already installed
--verbose Show verbose output
-h, --help This help
EOF
exit 0
fi
if $VERBOSE; then
writeGreen "Running `basename "$0"` $ALL_ARGS
Update is $UPDATE"
fi
sudo su --login root -c "'$BASEDIR/install-root-pkgs.sh' $*"
sudo su --login root -c "'$BASEDIR/configure-root-env.sh' $*"
if hash systemd-notify 2> /dev/null && systemd-notify systemd-notify --booted; then
sudo su --login root -c "'$BASEDIR/configure-systemd.sh' $*"
fi
sudo su --login "$USER" -c "'$BASEDIR/install-home-manager.sh' $*"
sudo su --login "$USER" -c "'$BASEDIR/install-platform-tools.sh' $*"