forked from jeremiahishere/dot-vim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
45 lines (39 loc) · 1.01 KB
/
Rakefile
File metadata and controls
45 lines (39 loc) · 1.01 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
PWD = ENV['PWD']
def install_in(path)
files = %w{ .config/nvim .tmux .vimrc .tmux.conf .gitignore }
files.each do |f|
source = File.join PWD, "/deploy", f
# Flattens filenames.
target = File.join path, f
if(File.exists?(target))
puts "#{target} already exists - not added."
else
%x(ln -s #{source} #{target})
end
end
append_files = %w{ .zshrc }
append_files.each do |f|
target = File.join path, f
source = File.join PWD, "/deploy", f
open(target,'a') do |file|
file.puts "source '#{source}'"
end
end
end
desc "Installs the .vim and .vimrc files"
task :install do
puts "Where to install? [#{ENV['HOME']}]"
%x(git submodule init)
%x(git submodule update)
root = $stdin.gets.chomp
root = root.empty? ? ENV['HOME'] : root
install_in root
%x(vim +PluginInstall +qall)
end
namespace :install do
desc "Installs using the default paths, with no user input"
task :no_user_input do
install_in ENV['HOME']
end
end
task :default => :install