Closed t3rminus closed 6 years ago
When uploading using gulpSSH.dest, the remote path includes the entire local path.
So a project stored at /home/user/projects/api/index.js /home/user/projects/api/lib/util.js
/home/user/projects/api/index.js
/home/user/projects/api/lib/util.js
gets deployed to the remote dest('/home/user/api') as /home/user/api/home/user/projects/api/index.js /home/user/api/home/user/projects/api/lib/util.js
dest('/home/user/api')
/home/user/api/home/user/projects/api/index.js
/home/user/api/home/user/projects/api/lib/util.js
instead of just /home/user/api/index.js /home/user/api/lib/util.js
/home/user/api/index.js
/home/user/api/lib/util.js
Example:
gulp.task('deploy:staging:copy', function(){ return gulp .src(['**/*'], { base: './' }) .pipe(gulpSSH.dest('/home/user/api')); });
I made a temporary work-around by adding a stream filter, as mentioned in #44 , which switches the file path for the relative file path:
gulp.task('deploy:staging:copy', function(){ return gulp .src(['**/*'], { base: './' }) .pipe(require('stream-filter').obj(function(file) { file.path = file.relative; return file; })) .pipe(gulpSSH.dest('/home/user/api')); });
But this seems inefficient and contrary to what is expected.
I agree that gulp-ssh should be using file.relative like vinyl-fs instead trying to manually relativize the file.
I'll propose a change.
When uploading using gulpSSH.dest, the remote path includes the entire local path.
So a project stored at
/home/user/projects/api/index.js
/home/user/projects/api/lib/util.js
gets deployed to the remote
dest('/home/user/api')
as/home/user/api/home/user/projects/api/index.js
/home/user/api/home/user/projects/api/lib/util.js
instead of just
/home/user/api/index.js
/home/user/api/lib/util.js
Example:
I made a temporary work-around by adding a stream filter, as mentioned in #44 , which switches the file path for the relative file path:
But this seems inefficient and contrary to what is expected.