Permalink
Browse files

Use touch command to update asset mtimes, instead of File.utime, whic…

…h fails unless user is owner of asset.
  • Loading branch information...
1 parent 0d9771b commit caa35888f688e1c71835b983af16af3e22dd2537 @ndbroadbent committed Dec 5, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/turbo-sprockets/tasks/assets.rake
View
4 lib/turbo-sprockets/tasks/assets.rake
@@ -77,7 +77,9 @@ namespace :assets do
known_assets.each do |asset|
full_path = File.join(target, asset)
if File.exist?(full_path)
- File.utime(Time.now, Time.now, full_path)
+ # File.utime raises 'Operation not permitted' unless user is owner of file.
+ # Non-owners have permission to update mtime to the current time using 'touch'.
+ `touch #{full_path}`
end
end
end

0 comments on commit caa3588

Please sign in to comment.