Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle arrays in normalize_asset_timestamps #185

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/capistrano/tasks/assets.rake
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ namespace :deploy do
desc 'Normalize asset timestamps'
task :normalize_assets => [:set_rails_env] do
on release_roles(fetch(:assets_roles)) do
assets = fetch(:normalize_asset_timestamps)
if assets
assets = fetch(:normalize_asset_timestamps, [])
assets = [assets] unless assets.respond_to?(:any?)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be cleaner?

assets = Array(assets)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Learn something new every day… I like that. Fixed.

if assets.any?
within release_path do
execute :find, "#{assets} -exec touch -t #{asset_timestamp} {} ';'; true"
execute :find, "#{assets.join(' ')} -exec touch -t #{asset_timestamp} {} ';'; true"
end
end
end
Expand Down