# this is what I ended up with, though I don't know that rollback
works quite right yet

def relative_path(from_str, to_str)
  require 'pathname'
 
Pathname.new(to_str).relative_path_from(Pathname.new(from_str)).to_s
end

namespace :deploy do
  desc "Relative symlinks for current/"
  task :symlink, :except => { :no_release => true } do
    if releases[-2] # not the first release
      previous_release_relative = relative_path(deploy_to,
previous_release)
      on_rollback { run "rm -f #{current_path}; ln -s
#{previous_release_relative} #{current_path}; true" }
    end

    latest_release_relative = relative_path(deploy_to, latest_release)
    run "rm -f #{current_path} && ln -s #{latest_release_relative}
#{current_path}"
  end
end


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to