teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

How to navigate folders on the remote? #3

Closed oskarrough closed 10 years ago

oskarrough commented 10 years ago

Hi, how would you navigate your remote? Tried using cd with exec but no luck, it returns whatever is in the root, not my subfolder.

gulp.task('exec', function () {
    return gulpSSH
        .exec(['cd subfolder/', 'ls -a', 'pwd'], {filePath: 'commands.log'})
        .pipe(gulp.dest('logs'));
});

In the end I want to do

  1. gulp build
  2. upload /dist using gulp-ssh to a specific folder on my remote
zensh commented 10 years ago

I suggest you using gulp-rsync to upload a folder. sftp in gulp-ssh can only upload or get a simple file currently.

oskarrough commented 10 years ago

ah great, that worked. Thank you.