teambition / gulp-ssh

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

[Question] How to download folders from server, not just a file? #102

Open SamuelMiller opened 2 years ago

SamuelMiller commented 2 years ago

How would I download a folder and its contents from the server? Following the documentation, which only shows reading individual files, I am able to download a file but not the other contents of the same folder.

This works:

function sftpRead() {
    return gulpSSH.sftp('read', '/home1/sixfacto/public_html/sambadusoleil/readme.md', { filePath: 'readme.md })
        .pipe(dest('lest'))
}

But not this:

function sftpRead() {
    return gulpSSH.sftp('read', '/home1/sixfacto/public_html/sambadusoleil/**', { filePath: 'sambadusoleil' })
        .pipe(dest('logs'))
}

nor this:

function sftpRead() {
    return gulpSSH.sftp('read', '/home1/sixfacto/public_html/sambadusoleil')
        .pipe(dest('logs'))
}

Is gulp-ssh capable of downloading folders from the server? I suspect I would have to use "gulpSSH.exec". But I don't know how. Any suggestions? Thanks.