Skip to content
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

copy*() preserveTimestamps: false behavior is OS-dependent #563

Merged
merged 1 commit into from
Apr 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/copy-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Copy a file or directory. The directory can have contents. Like `cp -r`.
- `overwrite` `<boolean>`: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior.
- `errorOnExist` `<boolean>`: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`.
- `dereference` `<boolean>`: dereference symlinks, default is `false`.
- `preserveTimestamps` `<boolean>`: will set last modification and access times to the ones of the original source files, default is `false`.
- `preserveTimestamps` `<boolean>`: When true, will set last modification and access times to the ones of the original source files. When false, timestamp behavior is OS-dependent. Default is `false`.
- `filter` `<Function>`: Function to filter copied files. Return `true` to include, `false` to exclude.

## Example:
Expand Down
2 changes: 1 addition & 1 deletion docs/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Copy a file or directory. The directory can have contents. Like `cp -r`.
- `overwrite` `<boolean>`: overwrite existing file or directory, default is `true`. _Note that the copy operation will silently fail if you set this to `false` and the destination exists._ Use the `errorOnExist` option to change this behavior.
- `errorOnExist` `<boolean>`: when `overwrite` is `false` and the destination exists, throw an error. Default is `false`.
- `dereference` `<boolean>`: dereference symlinks, default is `false`.
- `preserveTimestamps` `<boolean>`: will set last modification and access times to the ones of the original source files, default is `false`.
- `preserveTimestamps` `<boolean>`: When true, will set last modification and access times to the ones of the original source files. When false, timestamp behavior is OS-dependent. Default is `false`.
- `filter` `<Function>`: Function to filter copied files. Return `true` to include, `false` to exclude. Can also return a `Promise` that resolves to `true` or `false` (or pass in an `async` function).
- `callback` `<Function>`

Expand Down
10 changes: 0 additions & 10 deletions lib/copy-sync/__tests__/copy-sync-preserve-time.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ describeIfPractical('copySync() - preserveTimestamps option', () => {

afterEach(done => fs.remove(TEST_DIR, done))

describe('> when preserveTimestamps option is false', () => {
it('should have different timestamps on copy', done => {
setTimeout(() => {
fs.copySync(SRC, DEST, {preserveTimestamps: false})
FILES.forEach(testFile({preserveTimestamps: false}))
done()
}, 100)
})
})

describe('> when preserveTimestamps option is true', () => {
it('should have the same timestamps on copy', () => {
fs.copySync(SRC, DEST, {preserveTimestamps: true})
Expand Down
11 changes: 0 additions & 11 deletions lib/copy/__tests__/copy-preserve-time.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,6 @@ describeIfPractical('copy() - preserve timestamp', () => {

afterEach(done => fs.remove(TEST_DIR, done))

describe('> when timestamp option is false', () => {
it('should have different timestamps on copy', done => {
setTimeout(() => {
copy(SRC, DEST, {preserveTimestamps: false}, () => {
FILES.forEach(testFile({preserveTimestamps: false}))
done()
})
}, 100)
})
})

describe('> when timestamp option is true', () => {
it('should have the same timestamps on copy', done => {
copy(SRC, DEST, {preserveTimestamps: true}, () => {
Expand Down