Skip to content
Browse files

Don't shellescape latest_release. It can be nil during --dry-run

  • Loading branch information...
1 parent 1d392aa commit ef1c3a6fd8777ddf8a8372c45a506249a08a703e @ndbroadbent ndbroadbent committed Feb 8, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/capistrano/recipes/deploy/assets.rb
2 lib/capistrano/recipes/deploy/assets.rb
@@ -44,7 +44,7 @@
task :precompile, :roles => assets_role, :except => { :no_release => true } do
run <<-CMD.compact
- cd -- #{latest_release.shellescape} &&
+ cd -- #{latest_release} &&
#{rake} RAILS_ENV=#{rails_env.to_s.shellescape} #{asset_env} assets:precompile &&
cp -- #{shared_path.shellescape}/assets/manifest.yml #{current_release.shellescape}/assets_manifest.yml
dwbutler added a note Feb 13, 2013

current_release is also nil in my environment. I am running bundle exec cap HOSTFILTER=... production deploy with a server that doesn't have app or web role. The precompile step should be skipped, but this code still gets evaluated regardless. Perhaps current_release.shellescape rescue nil would work?

antono added a note Mar 1, 2013

It will not solve the problem. nil will be converted to empty string and assets_manifest.yml will be written to OS root.

dwbutler added a note Mar 4, 2013

As far as I can tell, these paths are only nil when the task is not run. If they were nil for any other reason, there would be some serious issues running all the capistrano tasks!

#395 fixes the problem for me.

antono added a note Mar 18, 2013


_cset(:current_release)   { releases.length > 0 ? File.join(releases_path, releases.last) : nil }

We can see that current_release will be always nil when we doing first deploy. And never before it caused problems iirc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

0 comments on commit ef1c3a6

Please sign in to comment.
Something went wrong with that request. Please try again.