lib/ash/magento.rb in capistrano-ash-1.3.3 vs lib/ash/magento.rb in capistrano-ash-1.3.4

- old
+ new

@@ -53,12 +53,12 @@ end desc "[internal] Touches up the released code. This is called by update_code after the basic deploy finishes." task :finalize_update, :roles => :web, :except => { :no_release => true } do # synchronize media directory with shared data - sudo "rsync -rltDvzog #{latest_release}/media/ #{shared_path}/media/" - sudo "chmod -R 777 #{shared_path}/media/" + try_sudo "rsync -rltDvzog #{latest_release}/media/ #{shared_path}/media/" + try_sudo "chmod -R 777 #{shared_path}/media/" # remove directories that will be shared run "rm -Rf #{latest_release}/includes" run "rm -Rf #{latest_release}/media" run "rm -Rf #{latest_release}/sitemap" @@ -106,11 +106,11 @@ run "ln -nfs #{shared_path}/var #{latest_release}/var" end desc "Purge Magento cache directory" task :purge_cache, :roles => :web, :except => { :no_release => true } do - sudo "rm -Rf #{shared_path}/var/cache/*" + try_sudo "rm -Rf #{shared_path}/var/cache/*" end desc "Watch Magento system log" task :watch_logs, :roles => :web, :except => { :no_release => true } do run "tail -f #{shared_path}/var/log/system.log" do |channel, stream, data| @@ -130,10 +130,10 @@ end desc "Clear the Magento Cache" task :cc, :roles => [:web, :app], :except => { :no_release => true } do magento.purge_cache - sudo "rm -rf #{shared_path}/var/full_page_cache/*" + try_sudo "rm -rf #{shared_path}/var/full_page_cache/*" end desc "Enable display errors" task :enable_dev, :roles => :web, :except => { :no_release => true } do run "perl -pi -e 's/#ini_set/ini_set/g' #{latest_release}/index.php"