teambition / gulp-ssh

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

ssh from windows to linux fails #25

Closed honzajde closed 9 years ago

honzajde commented 9 years ago

gulpfile:

var fs = require('fs');
var GulpSSH = require('gulp-ssh');

var sshConfig = {
    host: config.deploy_host,
    port: 22,
    username: config.deploy_host_username,
    privateKey: fs.readFileSync(config.deploy_host_private_key)
};

var ssh = new GulpSSH({
    ignoreErrors: false,
    sshConfig: sshConfig
});

gulp.task('deploy1', function () {
    return gulp
        .src(['*/**', '!**/node_modules/**', '!local/**', '!node_heapdumps'])
        .pipe(ssh.dest(config.deploy_host_dest))
});

gulp.task('deploy2', function () {
    return gulp
        .src(['main.js'])
        .pipe(ssh.sftp('write', config.deploy_host_dest + '/main.js')) // dest ending with /
});

Deploying from Widnows (Vista) to linux machine fails like this - hanging:

    [13:56:47] Using gulpfile c:\project\git\project\gulpfile.js
    [13:56:47] Starting 'deploy'...
    [13:56:47] gulp-ssh :: Connect...
    [13:56:49] gulp-ssh :: Ready
    [13:56:50] Preparing to write "\usr\honzajde\project\main.js"

Note that line: Preparing to write "\usr\honzajde\project\main.js has backslashes...

jscti commented 9 years ago

+1 this bug.

ssh.dest(path) doesn't work but ssh.sftp('write', filepath) works well.

zensh commented 9 years ago

It should be fixed at this weekend