-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
Copy pathdot
executable file
·65 lines (53 loc) · 1.15 KB
/
dot
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
#!/bin/sh
#
# dot
#
# `dot` handles installation, updates, things like that. Run it periodically
# to make sure you're on the latest and greatest.
set -e
parentDirectory="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd -P)"
dotfilesDirectory="$(cd "$( dirname "$parentDirectory" )" && pwd -P)"
displayUsageAndExit() {
echo "dot -- dotfiles management"
echo ""
echo "Usage: dot [options]"
echo ""
echo "Options:"
echo " -e, --edit Open dotfiles directory for editing"
echo " -h, --help Show this help message and exit"
exit
}
while test $# -gt 0; do
case "$1" in
"-h"|"--help")
displayUsageAndExit
;;
"-e"|"--edit")
exec "$EDITOR" "$dotfilesDirectory"
exit
;;
*)
echo "Invalid option: $1"
displayUsageAndExit
;;
esac
shift
done
export ZSH=$HOME/.dotfiles
# Update dotfiles themselves
echo "› git pull"
git -C $ZSH pull
# Set macOS defaults
$ZSH/macos/set-defaults.sh
# Set macOS hostname
$ZSH/macos/set-hostname.sh
# Install homebrew
$ZSH/homebrew/install.sh 2>&1
# Upgrade homebrew
echo "› brew update"
brew update
echo "› brew upgrade"
brew upgrade
# Install software
echo "› script/install"
$ZSH/script/install