Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dest command transfer all folders to remote? #44

Closed
csonlai opened this issue Mar 11, 2016 · 3 comments
Closed

dest command transfer all folders to remote? #44

csonlai opened this issue Mar 11, 2016 · 3 comments

Comments

@csonlai
Copy link

csonlai commented Mar 11, 2016

  return gulp
    .src(paths.dist.dir + '*.html')
    .pipe(gulpSSH.dest(paths.build.htmlDir));

as result,it transfer all folders to remote, not just the html files,
for example:
[17:33:40] Finished writing '/xx/x/remote_dir/d:/project/src/xx.html

how could i only transfer the html files to remote? thx

@csonlai
Copy link
Author

csonlai commented Mar 12, 2016

this bug only happen in windows file system,i think this will fix it:

getSftp(function (err, sftp) {
  if (err) return end(err, callback)

  file.base = file.base.replace(/\\/g,'/'); //add to fix bug in windows

  var baseRegexp = new RegExp('^' + file.base.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'))
  var outPath = path.join(destDir, file.path.replace(baseRegexp, '')).replace(/\\/g, '/')
  ..........

@zensh
Copy link
Collaborator

zensh commented Mar 12, 2016

You can try to add a filter stream between src and dest

gulp.src(htmlPath).pipe(filterStream).pipe(sshStream)

@csonlai
Copy link
Author

csonlai commented Mar 12, 2016

can filter stream change the file.base?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants