Skip to content

Instantly share code, notes, and snippets.

@danielvlopes
Created July 27, 2009 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danielvlopes/156788 to your computer and use it in GitHub Desktop.
Save danielvlopes/156788 to your computer and use it in GitHub Desktop.
namespace :assets do
task :symlink, :roles => :app do
assets.create_dir
run <<-CMD
rm -rf #{current_path}/public/images/upload &&
ln -nfs #{shared_path}/upload #{release_path}/public/images/upload
CMD
end
task :create_dir, :roles => :app do
run "test -d #{shared_path}/upload || mkdir -p #{shared_path}/upload"
end
end
after "deploy:update_code","assets:symlink"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment