-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·110 lines (98 loc) · 2.99 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
set -o errexit
([[ -n "$DEBUG" ]] || [[ -n "$TRACE" ]]) && set -o xtrace
task_init_dotfiles () {
git pull && git submodule init &&
git pull --recurse-submodules &&
git submodule update --recursive
}
task_brew () {
hash brew || (/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)")
brew update
brew bundle -v
}
task_fonts () {
(cd fonts; ./install.sh)
}
task_gitconfig () {
read -p 'git config user.email please: ' git_config_user_email
git config --global user.email "$git_config_user_email"
for i in $(ls ./git/hooks/*.tmpl); do
ln -f "$i" "/usr/local/share/git-core/templates/hooks/$(basename $i .tmpl)"
done
}
task_neovim () {
pip3 install neovim-remote
# pip install --upgrade neovim
mkdir -p ~/.config/nvim/ftplugin
mkdir -p ~/.config/nvim/after/ftplugin
mkdir -p ~/.config/nvim/undo
}
task_opt () {
sudo mkdir -p /opt/dotfiles
sudo chown $USER /opt/dotfiles
ln -Ffs opt /opt/dotfiles
for i in $(ls opt); do
echo "installing opt: ${i}"
zsh -c "cd opt/${i}; ./${i}.install"
done
}
task_ruby () {
bundle install
}
task_lua() {
luarocks install fennel
}
# TASK at each step (mainly brew) verify it worked before continue-ing
task_manual() {
echo "Run 'mkdir -p ~/Developer/bin'"
read -p "done?"
echo "Run 'mkdir ~/Screenshots && defaults write com.apple.screencapture location ~/Screenshots'"
read -p "done?"
echo "link /private/links/[home,dotfiles,projects] -> ~/..."
read -p "done?"
echo "Run 'ssh-keygen -t rsa'"
read -p "done?"
echo "Run 'ssh-add -K ~/.ssh/id_rsa'"
read -p "done?"
echo "Run 'sudo visudo /private/etc/sudoers' and append this line:"
echo "$(whoami) ALL=(ALL) NOPASSWD: /usr/sbin/nvram SystemAudioVolume=%80"
read -p "done?"
echo "Download SpoonInstall from here: https://github.com/Hammerspoon/Spoons/raw/master/Spoons/SpoonInstall.spoon.zip"
echo "Move it into ~/.hammerspoon/Spoons/"
read -p "done?"
echo "Install xcode, launch it, and accept the license."
read -p "done?"
echo "Run 'sudo brew services start vnstat'"
read -p "done?"
echo "manual steps done!"
# TASK spotlight search disable, bind cmd-space to show launchpad
}
task_all () {
task_init_dotfiles
task_brew
task_ruby
task_luarocks
task_fonts
task_gitconfig
task_manual
task_neovim
task_opt
}
main() {
[[ ! "$(pwd)" == "$HOME/dotfiles" ]] && (echo 'CANNOT EXECUTE outside of dotfiles root'; exit 2)
case "$1" in
'') task_all && exec zsh zsh/zshrc ;;
brew) task_brew ;;
gitconfig|git) task_gitconfig ;;
help) echo "init brew gitconfig neovim opt" ;;
init) task_init_dotfiles ;;
manual) task_manual ;;
neovim|nvim|vim) task_neovim ;;
opt) task_opt ;;
ruby) task_ruby ;;
lua) task_lua ;;
*) echo "Failed to recognize: '$@'" && exit 1 ;;
esac
}
main "$@"