mikeal / sequest

Simplified API for SSH and SFTP similar to request.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

commands that take too long cause sequest to report an error

jeffreywescott opened this issue · comments

Result: { [Error: Exit code is non-zero.] code: undefined, signal: undefined }

Attempted on both 0.7.0 (from npm) and 0.7.1 (from GitHub).

To reproduce, create a script /usr/local/bin/testscript on the remote server that looks like this:

#!/bin/sh

echo "foo"
echo "bar"
sleep 2
echo "baz"
var sequest = require('sequest');

var seq = sequest.connect('user@example.com');

// SUCCEEDS
seq('ls -alFh', function (err, stdout) {
  if (err) throw err;
  console.log(stdout);
  seq.end();
});

// FAILS
seq('testscript', function (err, stdout) {
  if (err) throw err;
  console.log(stdout);
  seq.end();
});

@jeffreywescott hmm thats interesting, as it doesn't seem like it should timeout with that short of a sleep. Could you see if you could dig a little deeper and see what you uncover?