gtg092x / gulp-sftp

Gulp SFTP Deploy
140 stars 61 forks source link

Remote file structure is incorrect #60

Open jdnichollsc opened 8 years ago

jdnichollsc commented 8 years ago

Hi guys,

This gulp plugin have a critical issue, because after to upload files, the remote file structure is different to local (source structure).

See the current configuration

var paths = [
    "./models/**",
    "./public/**",
    "./routes/**"
];

gulp.task('deploy', function(done) {
        gulp.src(paths)
        .pipe(sftp({...}))
        .on('end', done);
});

But in remote doesn't exist the _models_, _public_ and _routes_ folders. The contents of those folders is placed in the root :/

Thanks, Nicholls

jdnichollsc commented 8 years ago

mmm But works good with the following configuration

var paths = [
    "./**",
    "!./bin/**",
    "!./node_modules/**"
];

Regards, Nicholls

ghost commented 7 years ago

I was struggling with this for a long time, too, but it's actually not an issue of this lib, but of your configuration. Add an object with the property base targeting to your base path as second parameter of gulp.src: http://www.levihackwith.com/how-to-make-gulp-copy-a-directory-and-its-contents/

Hope this helps.