Created
May 13, 2014 10:10
-
-
Save kzaitsev/f922a2a3ca6b0ea28127 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :deploy do | |
before 'deploy:assets:precompile', :clean_css_cache do | |
on roles(:app), in: :sequence, wait: 5 do | |
within release_path do | |
if test("[ -d #{shared_path}/tmp/cache/assets ]") | |
if test("[ -d #{shared_path}/tmp/cache/assets/production ]") | |
if test("[ -d #{shared_path}/tmp/cache/assets/production/sprockets ]") | |
out = capture("grep -r -l 'application.css' #{shared_path}/tmp/cache/assets/production/sprockets/") | |
out.split("\n").each do |o| | |
execute :rm, o.gsub("\r", '').to_s | |
end | |
end | |
end | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment