Sha256: 3bef75e068102bc1d94fff64c41df9fee816d91d35e4545a1b38033b10c336c3

Contents?: true

Size: 943 Bytes

Versions: 7

Compression:

Stored size: 943 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do
  # These are set to the same structure in shared <=> current
  set :normal_symlinks, %w(
    config/database.yml
  ) unless exists?(:normal_symlinks)
  
  # Weird symlinks go somewhere else. Weird.
  set :weird_symlinks, {
     'bundle' => 'vendor/bundle'
  } unless exists?(:weird_symlinks)

  namespace :symlinks do
    desc "Make all the damn symlinks in a single run"
    task :make, :roles => :app, :except => { :no_release => true } do
      commands = normal_symlinks.map do |path|
        "rm -rf #{current_path}/#{path} && \
         ln -s #{shared_path}/#{path} #{current_path}/#{path}"
      end

      commands += weird_symlinks.map do |from, to|
        "rm -rf #{current_path}/#{to} && \
         ln -s #{shared_path}/#{from} #{current_path}/#{to}"
      end


      run <<-CMD
        cd #{current_path} &&
        #{commands.join(" && ")}
      CMD
    end
  end
  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dark-capistrano-recipes-0.6.11 lib/recipes/symlinks.rb
dark-capistrano-recipes-0.6.10 lib/recipes/symlinks.rb
dark-capistrano-recipes-0.6.9 lib/recipes/symlinks.rb
dark-capistrano-recipes-0.6.8 lib/recipes/symlinks.rb
dark-capistrano-recipes-0.6.6 lib/recipes/symlinks.rb
dark-capistrano-recipes-0.6.5 lib/recipes/symlinks.rb
dark-capistrano-recipes-0.6.4 lib/recipes/symlinks.rb