Skip to content

Instantly share code, notes, and snippets.

@kzaitsev
Created May 13, 2014 10:10
Show Gist options
  • Save kzaitsev/f922a2a3ca6b0ea28127 to your computer and use it in GitHub Desktop.
Save kzaitsev/f922a2a3ca6b0ea28127 to your computer and use it in GitHub Desktop.
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