Skip to content

Instantly share code, notes, and snippets.

@armstrjare
Created May 3, 2012 02:49
Show Gist options
  • Save armstrjare/2582670 to your computer and use it in GitHub Desktop.
Save armstrjare/2582670 to your computer and use it in GitHub Desktop.
task :precompile, :roles => :web, :except => { :no_release => true } do
needs_recompile = if current_revision
from = source.next_revision(current_revision)
capture("cd #{latest_release} && #{source.local.log(from)} #{asset_precompile_locations.join(' ')} | wc -l").to_i > 0
end
# Symlink public/assets to the shared assets directory.
symlink
if needs_recompile
recompile
else
logger.info "Skipping asset pre-compilation because there were no asset changes"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment