Not quite that easy, unfortunately, but you could do something like  
this:

   return_code = nil
   run "something; echo return code: $?" do |channel, stream, data|
     if data =~ /return code: (\d+)/
       return_code = $1.to_i
     else
       Capistrano::Configuration.default_io_proc.call(channel, stream,  
data)
     end
   end

   puts "finished with return code: #{return_code}"

- Jamis

On Jun 1, 2008, at 3:05 PM, Rich Morin wrote:

>
> I'd like to know if there's a way to get the return code from
> a failing "run" command.  Perhaps something like this:
>
>  begin
>    run ...
>  rescue => e
>    rc = e.ret_code
>  end
>
> -r
> -- 
> http://www.cfcl.com/rdm            Rich Morin
> http://www.cfcl.com/rdm/resume     [EMAIL PROTECTED]
> http://www.cfcl.com/rdm/weblog     +1 650-873-7841
>
> Technical editing and writing, programming, and web development
>
> >


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to