Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make remote.cd work #2

Closed
reaktivo opened this issue Feb 23, 2014 · 1 comment
Closed

Make remote.cd work #2

reaktivo opened this issue Feb 23, 2014 · 1 comment
Labels

Comments

@reaktivo
Copy link

How can I make the following work?

plan.remote(function(remote) {
  remote.pwd();
  remote.cd("testfolder");
  remote.pwd();
  remote.git('pull')
  remote.npm('install')
  remote.exec("pm2 reload #{host}")
})

Both calls to pwd() return the same directory.

@pstadler
Copy link
Owner

This is currently not possible since Flightplan uses exec from mscdex/ssh2 to execute commands on remote flights. Even though this library offers the possibility to use an interactive shell, I'd rather stick to the current behavior because commands executed on local flights are non-interactive as well.

Possible solution:

var folder = 'testfolder';
remote.exec('cd ' + folder + ' && git pull');
remote.exec('cd ' + folder + ' && npm install');
// or with prefix: remote.npm('install --prefix ' + folder + ' ' + folder);

See mscdex/ssh2#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants