#!/bin/sh
# Cleanup temporary directory
-find <%= @directory %>/tmp -mtime +28 -print0 | xargs -0r rm
+find <%= @directory %>/tmp \( \( -type f -mtime +28 \) -o \( -type d -empty \) \) -delete
+
+# Cleanup assets
+/usr/local/bin/cleanup-rails-assets <%= @directory %>