Friday, 15 March 2013

javascript - cd command not executed on grunt-ssh task -



javascript - cd command not executed on grunt-ssh task -

i'm running task "grunt-ssh" github/ssh, , works fine, except cd command, here code:

grunt.initconfig({ sshexec: { connect: { command: ['ls'], options: { host: 'some_host', username: 'user', password: 'pass' } } });

the output illustration is: /folder1, /folder2, /etc, /etc

but when run same task e.g.:

command: ['cd /', 'ls'],

(the output should : /root, /foldera, /folderb, /etc, /etc) instead of same : /folder1, /folder2, /etc, /etc seem thet th command "cd /" not executed.

any ideas?

i suspect cd command is executed, in such way doesn't impact subsequent command. it's executed own process, 1 time it's done next process starts off in same directory.

this should work:

command: ['sh -c "cd /; ls"'],

javascript ssh gruntjs task grunt-ssh

No comments:

Post a Comment