Skip to content

Instantly share code, notes, and snippets.

@jtadeulopes
Forked from danielvlopes/assets_recipe.rb
Created July 29, 2009 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtadeulopes/158215 to your computer and use it in GitHub Desktop.
Save jtadeulopes/158215 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