spmjs / node-scp2

[MAINTAINER WANTED] A pure javascript scp program based on ssh2.
385 stars 96 forks source link

Copying a directory does not copy hidden files (.*) #23

Open julienbachmann opened 9 years ago

julienbachmann commented 9 years ago

I've noticed that when I use scp2 to copy an entire directory, then all hidden file (.something) that are in subfolder are not copied.

lepture commented 9 years ago

Check the glob pattern: https://github.com/spmjs/node-scp2/blob/master/lib/scp.js#L54

julienbachmann commented 9 years ago

so, yes glob can copy hidden file but you have to give the option { dot:true } when calling glob. Otherwise dot file are not returned by glob (read Dots chapter here https://www.npmjs.com/package/glob).

And unfortunately scp2 does use this option so I think you should also add this option to scp2 and then use it when calling glob. Or use it by default as scp command line copy hidden file when copying directory.

starak commented 8 years ago

@julienbachmann I have found a workaround (in gulp) for this problem by just adding the hidden files manualy like this:

return gulp.src( ['dist/**/*', './dist/.htaccess', 'dist/.htpasswd'] )...

Or even better:

gulp.src( ['dist/**/*', './dist/**/.*'] )

Works for me.

DaveDev13 commented 5 years ago

From what I can tell this isn't a copy issue but rather a issue with gulp.src(). I too would like **/*.* to find ALL files, as that's literally what is being said. Perhaps what is needed is partial regular expressions like: **/*[.]?*