-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
executable file
·68 lines (58 loc) · 1.6 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
66
67
68
#TODO: adapt the rakefile for my situation
#
require 'fileutils'
desc 'Link dotfiles'
task :link do
link_dir = Dir.pwd
Dir.chdir ENV['HOME']
files = %w[.vimrc .vim]
files += %w[.tmux.conf .tmux .tmux.status.conf]
files += %w[.zlogin .zlogout .zpreztorc .zprofile .zshenv .zshrc .zprezto]
files += %w[.ackrc]
files += %w[.slate]
files += %w[.gemrc]
files += %w[.powconfig]
files += %w[.pryrc .pry]
files.each do |file_or_dir|
if File.exists?(file_or_dir)
print "Remove #{file_or_dir} (y/N)? "
answer = STDIN.gets
if answer.chomp == 'y'
FileUtils.rm_rf file_or_dir
else
next
end
end
sh "ln -s #{link_dir}/#{file_or_dir}"
end
end
desc "Install dependencies"
task :brew do
sh 'brew bundle'
end
namespace :bootstrap do
desc "Bootstrap vim"
task :vim do
bundle_dir = File.join('.vim', 'bundle')
vundle_dir = File.join(bundle_dir, 'vundle')
sh "git clone https://github.com/gmarik/vundle.git #{vundle_dir}" unless File.exists?(vundle_dir)
sh "brew install ctags"
sh "vim -c ':BundleInstall' -c ':quitall'"
Dir.chdir File.join(bundle_dir, 'YouCompleteMe') do
if File.exists?(File.join('python', 'ycm_core.so'))
puts 'YouCompleteMe already compiled'
else
sh './install.sh --clang-completer'
end
end
end
desc "Bootstrap zsh"
task :zsh do
prezto_dir = File.join('.zprezto')
sh "git clone git@github.com:luxflux/prezto.git #{prezto_dir}" unless File.exists?(prezto_dir)
Dir.chdir prezto_dir do
sh 'git submodule init'
sh 'git submodule update'
end
end
end