forked from holman/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot
executable file
·59 lines (49 loc) · 1.09 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
#!/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
# Set macOS defaults
$DOTFILES/macos/set-defaults.sh
# Install homebrew
$DOTFILES/brew/install.sh 2>&1
# Upgrade homebrew
echo "› brew update"
brew update
# Install software
echo "› $DOTFILES/script/install"
$DOTFILES/script/install
# Link stuff
echo "› $DOTFILES/script/link"
$DOTFILES/script/link