Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (37 sloc) 1.01 KB
require 'rake'
require 'find'
require 'pathname'
PLUGIN = [
"plugin/jslint/fulljslint.js",
"plugin/jslint/parser.js",
"plugin/jslint/jslint.vim"
]
files = PLUGIN
desc 'Zip up the project files'
task :zip do
zip_name = File.basename(File.dirname(__FILE__))
zip_name.gsub!(/ /, '_')
zip_name = "#{zip_name}.zip"
if File.exist?(zip_name)
abort("Zip file #{zip_name} already exists. Remove it first.")
end
puts "Creating zip file: #{zip_name}"
system("zip #{zip_name} #{files.join(" ")}")
end
desc 'Install plugin and documentation'
task :install do
vimfiles = if ENV['VIMFILES']
ENV['VIMFILES']
elsif RUBY_PLATFORM =~ /(win|w)32$/
File.expand_path("~/vimfiles")
else
File.expand_path("~/.vim")
end
target_dir = File.join(vimfiles, 'plugin', 'jslint')
FileUtils.mkdir_p target_dir
files.each do |file|
FileUtils.cp file, target_dir
puts "Installed #{file} to #{target_dir}/"
end
end
task :default => :install