calvinmetcalf / copyfiles

copy files on the command line
MIT License
411 stars 52 forks source link

Alternative to copyfiles compatible with both linux and windows? #75

Open FredericLatour opened 4 years ago

FredericLatour commented 4 years ago

Does anybody know an alternative to this tool that is compatible with both linux and windows? I've spent hours and hours because of weird behaviors with linux and I'm afraid that even if I could find an immediate solution, i might be bitten with an edge case at a later time.

sondreb commented 3 years ago

I came here looking for the same, I'm getting different copy behavior between Ubuntu and Windows.

Ubuntu: image

Windows: image

sondreb commented 3 years ago

I fixed my issue by escaping the search pattern, had similar issue previously with different shell and OS. Depending on if you quote or not, it might differ how and what is resolving the glob you enter.

So doing something like \"ui/dist/**/*\" will help.

https://github.com/calvinmetcalf/copyfiles/issues/61

calvinmetcalf commented 3 years ago

yes double quotes are needed on globs in windows (and thats probably something that's going to affect other libraries too)

On Tue, Jul 27, 2021 at 12:54 PM SondreB @.***> wrote:

I fixed my issue by escaping the search pattern, had similar issue previously with different shell and OS. Depending on if you quote or not, it might differ how and what is resolving the glob you enter.

So doing something like \"ui/dist/*/\" will help.

61 https://github.com/calvinmetcalf/copyfiles/issues/61

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/calvinmetcalf/copyfiles/issues/75#issuecomment-887673818, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAITRHYFCZGCNH76WFGQGXDTZ3QF5ANCNFSM4I5IZCXA .

-- -Calvin W. Metcalf

sondreb commented 3 years ago

It depends on both OS and shell, in my example I was using pwsh (Powershell Core) on Ubuntu, where it failed. Worked fine on Windows. I have been bit by this behavior multiple times in my devops work =)

rujorgensen commented 2 years ago

I'm interested in the original question as well, anyone know of a good alternative 🙂? (having some other issues with it, and would rather not spend more time on it)

calvinmetcalf commented 2 years ago

the the real issue ends up being how shells interpret things before it even gets to this (or any other) library so there may not be a library that does what you want

calvinmetcalf commented 2 years ago

this is mostly fixed with double quotes