Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cp is changing file date with -u option #976
Comments
|
Looks like a bug. I can repro on my Linux system as well. Let me know if you're interested in sending a fix. |
|
Looks like a bad interaction with passing directories as arguments. shx cp -RLu srcDir/baz.txt targDir/srcDir/baz.txt # No bug
shx cp -RLu srcDir targDir # This has the bugThis was probably a case I overlooked in the original implementation of the feature. |
|
A fix would be great if you have one. I haven't actually looked at the code
behind shelljs...
…On Mon, Nov 11, 2019 at 1:38 PM Nate Fischer ***@***.***> wrote:
Looks like a bug. I can repro on my Linux system as well.
Let me know if you're interested in sending a fix.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#976?email_source=notifications&email_token=AA2JD4SQBEI2PV3XMZL43E3QTG7ELA5CNFSM4JJJMMNKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDYBMYA#issuecomment-552605280>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2JD4TGTDEJZRUAAU6HMVLQTG7ELANCNFSM4JJJMMNA>
.
|
|
Does shelljs support the -p option to preserve timestamp information? |
|
shelljs cp command ought to support a -p (preserve) option to preserve timestamps. Something along the lines of: copyFileSync in cp.js should check for the preserve option and copy the timestamps. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

I'm using NodeJS v10.13.0, with shelljs 0.8.3, under Mac OSX 10.13.6, and am performing a copy command, such as:
My understanding is that -u should copy only newer files. But, after a copy, I am seeing the timestamp on the existing files in the target directory are changed to the current time, thus defeating the point of the copy operation to leave existing files unchanged.