[capistrano] Re: Changing directory in task

2013-11-09 Thread Stephen Benner
Aaand now I feel a bit ridiculous, because shortly after posting, I was chatting to some goys in IRC, and was pointed towards a better solution that is built right into SSHKit! https://github.com/leehambley/sshkit/blob/master/EXAMPLES.md def within(directory, block) (@pwd ||=

[capistrano] Re: Changing directory in task

2013-11-06 Thread Stephen Benner
This is an old thread, but just wanted to mention a clean, easy solution that I'm using - I just add an 'execute_at' method to the Capistrano DSL module and it's working fantastically. https://gist.github.com/SteveBenner/7333298 On Tuesday, October 14, 2008 12:49:21 AM UTC-7, thomas.mery

[Capistrano] Re: Changing directory in task

2008-10-14 Thread thomas.mery
Thanks for the answers this clears things for me :) thomas On Oct 9, 8:22 pm, Lee Hambley [EMAIL PROTECTED] wrote: It is worth noting for the sake of completeness - although it's more of a Bash (or any shell) feature. That will execute the following task only if the first one is

[Capistrano] Re: Changing directory in task

2008-10-09 Thread Lee Hambley
It is worth noting for the sake of completeness - although it's more of a Bash (or any shell) feature. That will execute the following task only if the first one is successful. run cd /path ls -al Wouldnt' run the ls command if it couldn't change directory.. which in this instance makes

[Capistrano] Re: Changing directory in task

2008-10-08 Thread Jamis Buck
Each run() is done in a subshell, so any changes made to your session's state there are lost. Similarly, you cannot set environment variables that you want to persist across run calls, either. The way to do this is to execute all the commands together in a single run() invocation: run