Skip to content

Instantly share code, notes, and snippets.

@gnufied
Created April 11, 2013 17:38
Show Gist options
  • Save gnufied/5365462 to your computer and use it in GitHub Desktop.
Save gnufied/5365462 to your computer and use it in GitHub Desktop.
run <<-CMD.compact
cd -- #{deploy_to.shellescape}/ &&
LC_COLLATE=C sort REQUIRED_ASSETS -o REQUIRED_ASSETS &&
cd -- #{shared_path.shellescape}/assets/ &&
for f in $(
find * -mmin +#{expire_after_mins.to_s.shellescape} -type f | LC_COLLATE=C sort |
LC_COLLATE=C comm -23 -- - #{deploy_to.shellescape}/REQUIRED_ASSETS
); do
echo "Removing unneeded asset: $f";
rm -f -- "$f";
done;
rm -f -- #{deploy_to.shellescape}/REQUIRED_ASSETS
CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment