rescue failure to backup assets

This commit is contained in:
Sam 2017-03-20 13:43:59 -04:00
parent e14a63cc88
commit bc96f0fe78
1 changed files with 7 additions and 1 deletions

View File

@ -176,7 +176,13 @@ task 'assets:precompile' => 'assets:precompile:before' do
manifest.send :save
if backup_path=ENV["BACKUP_ASSET_PATH"]
FileUtils.cp_r("#{Rails.root}/public/assets/.", backup_path)
begin
FileUtils.cp_r("#{Rails.root}/public/assets/.", backup_path)
rescue => e
STDERR.puts "Failed to backup assets to #{backup_path}"
STDERR.puts e
STDERR.puts e.backtrace
end
end