Replies: 1 comment
-
|
Both cd() and cwd: do the same job: changing the working directory for run commands. cd() can change role for the whole task, while cwd: can change working dir only for one run() call. set('deploy_path', '~/deployer.org');
task('task1', function () {
cd('{{deploy_path}}');
run('pwd');
// output: /home/deployer/deployer.org
run('pwd', cwd: '/usr'); // Only override the working directory for this run.
// output: /usr
run('pwd');
// output: /home/deployer/deployer.org
});Note hwat cd() only changes working directory for single task. task('task2', function () {
run('pwd'); // cd from previous run not used.
// output: /home/deployer
});
task('all', [
'task1',
'task2',
]);$ dep all -v
task task1
[deployer.org] run cd ~/deployer.org && (pwd)
[deployer.org] /home/deployer/deployer.org
[deployer.org] run cd /usr && (pwd)
[deployer.org] /usr
[deployer.org] run cd ~/deployer.org && (pwd)
[deployer.org] /home/deployer/deployer.org
task task2
[deployer.org] run pwd
[deployer.org] /home/deployer |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m currently testing the new v8 and came across the option to set cwd. Until now, I’ve been using the cd() function. I’d like to ask whether this is supposed to work as a replacement. I’m not sure if it should support using {{variable}} in cwd or not. I tried it like this:
result is:
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions