Closed anodynos closed 1 month ago
Probably a bug introduced after I updated the glob library, which required a few changes to how ignore strings were handled. Thank you for the example, I will get it fixed. In the meantime, feel free to run the last latest version to avoid the issue.
cause watch dosn't work on Network drives apparently...
Looks like this lib uses fs.watch, with has a fairly well known set of limitations: https://nodejs.org/api/fs.html#caveats
I would be open to swapping out to https://github.com/paulmillr/chokidar and exposing a --polling flag or something which WOULD work for network file systems, but I probably won't get around to it any time soon. Interested in looking into it?
Hey Bret, thanks for your response and concern.
I use chokidar
as well, it's not without its caveats, but you can navigate around them. The network watch I think is tricky, and not so important. I just run cpx2 in a loop every couple of seconds, and done. Since --update
works, I don't care about some extra reads in my ./src
files!
I would absolutely love to work on it, your library in spec is the best out there, supporting --update
& --watch
& --ignore
, I don't think any other does it... Unfortunately no time atm ;-(
I use the latest 6.0.1
already, do you mean the main branch directly?
Also, I noticed it doesn't copy hidden files (eg starting with .
) and there's no option for it! This should be a trivial change, can you please add it?
Angelos ;-)
PS: nice stuff you got on https://bret.io/, but I think cpx2 deserves a mention too!
I’m planning on fixing the relative path error asap. Chokidar would be nice but it might be a bit longer till I get to it. I don’t work with nfs very often.
I think the dotfile thing is a glob option that's just a matter of exposing so it should be easy.
Mostly credit goes to mysticatea who did the bulk of the work originally!
Still planning on working on this.
Bumping to remind myself to look at this issue soon. Please use an older version or a workaround (working out of a parent of the src directory) in the meantime.
Oh no, I just hit this and now my release is bust. I'm gonna go back to prior version but +1 on this being the best copy library out there.
Sorry about that, I may have some time to fix here soon.
@bcomnes I've hit this as well.
@bcomnes got hurt by this as well :(
Arg sorry folks. I'll get a hot fix out. I can just bypass the ignore glob error for the outer relative path case.
Taking a stab at this right now. Sorry for taking so long.
If you are still with me, give cpx2@7.0.2 or v8.0.0 (updated deps) a try.
works here
Hey and thanks for this great lib! It's the best copy out there! But I faced a daring bug:
(Also related to same error message https://github.com/bcomnes/cpx2/issues/44)
My cmd is
so I want to copy from a deep path, into my CWD.
It fails with a a gazzillion of these - it enumerates all my files and node_modules (despite being ignored). For each file (mine & node_modules) it throws:
Then it copies all the files I wanted, witch a glitch: ALWAYS, despite having
--update
.Now the interesting thing is, if I reverse the paths, everything works fine:
Something's wrong with the globbing apparently, but after some digging I think it doesnt like absolute directories.
I converted to relative paths, and boom, all good.
UPDATE: It's not relative paths either, it crashes the same with them as well.
But when I add
--watch
the problem goes away!Works:
Fails:
Great irony, I wanted to do it in a sleep loop "while sleep 5 ; cpx ...." cause watch dosnt work on Network drives apparently...
Any ideas?
Thanks again!