diaspora/lib/tasks/after_deploy.rake
2012-01-19 19:20:11 -08:00

13 lines
503 B
Ruby

desc "revert custom landing page commit after heroku san deploys"
task :after_deploy => :environment do
# Perform this task only if custom landing page is not present in app/views/home/_show.html.haml
if File.exist?(File.join(Rails.root, "app", "views", "home", "_show.html.haml")) && system("git log | head -5 | grep 'custom\ landing\ page'")
puts "-----> resetting HEAD before custom landing page commit"
system("git reset --hard HEAD^") ? true : fail
puts "-----> done"
end
end