I changed the 12 failing tests to expect single quotes and everything
seems to be working now. I tried both 'deploy' and 'deploy:rollback'
in my Rails app, with both tcsh and sh as the remote user's default
shell.

I pushed the change to scottj97/capistrano. Lee, I will send a pull
request.

Thanks for everybody's help.



On 19 May, 20:35, Scott Johnson <[email protected]> wrote:
> This seems to work -- but I'm not sure I understand the full effects
> of this change.
>
> I changed command.rb line 213 to use single instead of double quotes:
>
> cmd = "'#{cmd}'"
>
> But what about the gsub in line 212 that's quoting $ and double
> quotes? I assume with single quotes now we don't need to quote the $
> anymore. And the syntax for quoting single quotes is rather ugly.
>
> The following syntax seems to work on tcsh and bash both:
>
> % echo 'this is '\''quoted'\'' so there'
> this is 'quoted' so there
>
> So the gsub becomes:
> cmd = cmd.gsub(/'/) { |m| "'\\''" }
>
> This seems to work, with either tcsh or bash as default shell.
>
> But now 12 tests in command_test.rb are failing... probably because
> they expected double quotes?
>
> On 19 May, 18:42, Jamis Buck <[email protected]> wrote:
>
> > Ah! I think I may have found a work-around.
>
> > If you use single-quotes instead of double-quotes, the string isn't
> > immediately interpolated, so:
>
> >    sh -c 'echo I need some `help`'
>
> > appears to work, even if the calling shell is tcsh. Can you verify?
>
> > - Jamis
--~--~---------~--~----~------------~-------~--~----~
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