-
Notifications
You must be signed in to change notification settings - Fork 2
/
Rakefile
65 lines (55 loc) · 1.3 KB
/
Rakefile
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
require 'rake'
require 'fileutils'
desc "Yay! mount my env"
task :install do
["nvim", "zsh", "tmux", "git"].each do |task|
Rake::Task[task].execute
end
end
desc "neovim configs"
task :nvim do
puts "install neovim config"
run %{
ln -nfs $HOME/dev/dotfiles/nvim $HOME/.config/nvim
ln -nfs $HOME/dev/dotfiles/ideavimrc $HOME/.ideavimrc
}
end
desc "zsh configs"
task :zsh do
puts "install zsh config"
run %{
mkdir -p $HOME/.zsh.prompts
ln -nfs $HOME/dev/dotfiles/zsh $HOME/.zsh
ln -nfs $HOME/dev/dotfiles/zsh/zshrc $HOME/.zshrc
}
Rake::Task["prezto"].execute
run %{ chsh -s /usr/bin/zsh }
end
task :prezto do
run %{
cd ~/dev/dotfiles/zsh
git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
ln -nfs "$HOME/.zsh/zpreztorc" "${ZDOTDIR:-$HOME}/.zpreztorc"
}
end
desc "tmux conf"
task :tmux do
puts "install tmux conf"
run %{
ln -nfs $HOME/dev/dotfiles/tmux.conf $HOME/.tmux.conf
}
end
desc "gitconfig"
task :git do
puts "install git configs"
run %{
ln -nfs $HOME/dev/dotfiles/gitconfig $HOME/.gitconfig
ln -nfs $HOME/dev/dotfiles/gitignore $HOME/.gitignore
ln -nfs $HOME/dev/dotfiles/fdignore $HOME/.fdignore
}
end
private
def run(cmd)
puts "[Running] #{cmd}"
`#{cmd}` unless ENV['DEBUG']
end