Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 815 Bytes
require 'rake'
desc 'Install the style into Application Support folder'
task :install do
directories = ['styles', 'unsupported']
targets = directories.map { |directory| "#{ENV['HOME']}/Library/Application Support/Propane/#{directory}" }
# Back up old files
targets.each do |directory|
# Only make back ups if these are originals (i.e. no backup exists already)
if File.exists?(directory) && !File.exists?("#{directory}.backup")
`mv "#{directory}" "#{directory}.backup"`
end
end
# Delete targets and copy new ones to it
targets.each do |directory|
FileUtils.rm_rf(directory) if File.exists?(directory)
end
directories.each do |directory|
target = "#{ENV['HOME']}/Library/Application Support/Propane/#{directory}"
`cp -R "$PWD/#{directory}" "#{target}"`
end
end