-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
37 lines (30 loc) · 938 Bytes
/
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
require 'rake'
require 'find'
require 'pathname'
IGNORE_FILES = [/^\.gitignore$/, /^Rakefile$/,/^README.textile$/,/^zip/]
files = `git ls-files`.split("\n")
files.reject! { |f| IGNORE_FILES.any? { |re| f.match(re) } }
vim_dir=File.expand_path("~/.vim")
desc "zip project version"
task :zip do
system("zip zip/codepath.zip #{files.join(" ")}")
end
desc 'pull from git repository'
task :pull do
puts "Updating from git repository"
system("cd " << Dir.new(File.dirname(__FILE__)).path << " && git pull")
end
desc "install codepath in #{vim_dir} dir"
task :install do
files.each do |file|
if File.exists?(file)
target_file = File.join(vim_dir, file)
FileUtils.mkdir_p File.dirname(target_file)
FileUtils.cp file, target_file
puts "Installed #{file} to #{target_file}"
else
puts "#{file} removed?"
end
end
end
task :default => :zip