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
cp -Ru respects the -R but not the -u #808
Comments
Hi @jaawerth, thanks for reporting this. I am able to reproduce this on Ubuntu 16.04 with node 6.12 and ShellJS 0.7.8. Could you point out where you think the fix is? |
@freitagbr - I took another look, and I don't think the fix is where I thought it was - I thought the recursive code was failing to account for "update" but it's just wrapping the function that does so. It seems like some of the code here could be simplified some by breaking things down into small functions, but that's admittedly beyond the scope of fixing this bug.. Now it's gonna but me, so I'll tinker with it some more this week, time permitting, and see what I can find! |
@freitagbr can you take a look at this later? Not a big priority, but it'd be good to test and fix. |
Yeah, I will take a look when I get the chance. |
https://github.com/shelljs/shelljs/blob/master/src/cp.js#L263
|
@joshi-sh thanks for the pointer. Feel free to send a PR. At first glance, we should just pass Related: we should rewrite cmdOptions: {
'f': 'force', // <-- change double-negative ("not no force") to positive
'n': '!force',
// ...
'L': 'followSymlinks', // <-- camel case
'P': 'preserveSymlinks', // <-- it'd be nice to rename to !followSymlink, but I don't think this is technically feasible.
}, |
|
I think |
Fixed `cp -Ru` ignoring `-u`, and added a test. Fixes #808
@nfischer I am affected by this bug. Could you please release |
We've landed breaking changes on master branch, but v0.9.0 isn't ready. Cutting v0.8.4 would be nontrivial, because I would need to create a release branch and cherry-pick changes. I'm not opposed to doing this, I just haven't had the time. |
Love the lib - was looking to use this to reduce copy times on builds, but ran into the following:
Node version (or tell us if you're using electron or some other framework):
8.6.0
ShellJS version (the most recent version/Github branch you see the bug on):
shelljs 0.7.8, tested both directly and via shx 0.2.2
Operating system:
Arch Linux (kernel 4.13.12-1)
Description of the bug:
When combining
recursive
-R
andupdate
-u
options in bothshelljs
andshx
, "recursive" overrides and ignores "update" - files are recursively copied regardless of whether the src files are newer than dist.Example ShellJS command to reproduce the error:
Test case (assuming src/static and dist/static have contents)
Expected result
Same as
I think I see where the fix is - just wanted to file this before I forgot in case I don't end up having time in the near future to create a PR.
The text was updated successfully, but these errors were encountered: