Sha256: 84c4c49b7338067d6a6991fe28553250f89c8d8a89f5e1c91bb58f66b9014a13

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

after "deploy:update_code", "symlinks:create"

set(:symlink_dirs, [])
set(:symlink_absolute_dirs, [])

namespace :symlinks do

  desc <<-DESC
  fix symlinks to shared directory
  DESC
  task :fix, :roles => [:app, :web] do
    # for folders stored under public
    symlink_dirs.each do |share|
      run "rm -rf #{current_path}/#{share}"
      run "mkdir -p #{shared_path}/#{share}"
      run "ln -nfs #{shared_path}/#{share} #{current_path}/#{share}"
    end
  end

  desc <<-DESC
  create symlinks to shared directory
  DESC
  task :create, :roles => [:app, :web] do
    # for folders stored under public
    symlink_dirs.each do |share|
      run "rm -rf #{release_path}/#{share}"
      run "mkdir -p #{shared_path}/#{share}"
      run "ln -nfs #{shared_path}/#{share} #{release_path}/#{share}"
    end

    symlink_absolute_dirs.each do |share|
      run "rm -rf #{share[:symlink]}"
      run "mkdir -p #{share[:source]}"
      run "ln -nfs #{share[:source]} #{share[:symlink]}"
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
factorylabs-fdlcap-0.1.0 lib/fdlcap/symlinks.rb