-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetuposx
More file actions
executable file
·48 lines (35 loc) · 1.04 KB
/
setuposx
File metadata and controls
executable file
·48 lines (35 loc) · 1.04 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
#!/usr/bin/env zsh
# config
shopt -s dotglob
run() {
printf "\e[0;36m==> \e[1;39m%s\e[m\n" "$*" >&2
"$@"
result=$?
if [[ "$result" != "0" ]]; then
printf "\e[0;31m==> \e[1;31mError:\e[m %s\n" "Return code $result"
exit $result
fi
}
brewdir=$(run brew --prefix)
# 2: install bundle
run brew tap homebrew/bundle
# 3: process brewfile
run brew bundle
# 4: force link certain formulae
run brew link --force bzip2 curl perl sqlite3
# TODO: class-dump is broken
for i in "$brewdir"/opt/{coreutils,findutils,gnu-sed,gnu-tar,gnu-which,grep,make}/bin/g*; do
name=$(basename "$i")
newname=$brewdir/bin/${name:1}
if [[ ! -f $newname ]]; then
run ln -s "$i" "$newname"
fi
done
# 5: install font
curl -# https://rawgit.com/gabrielelana/awesome-terminal-fonts/patching-strategy/patched/SourceCodePro+Powerline+Awesome+Regular.ttf -o ~/Library/Fonts/SourceCodePro+Powerline+Awesome+Regular.ttf
for i in .gitconfig .htoprc .lldbinit .nanorc .nicrc do
if [[ ! -f ~/$i ]]; then
run ln -s .dotfiles/$i ~/$i
fi
done
run echo "source $PWD/.zshrc" >> ~/.zshrc