From 0e0fcb88dcfe8f2f008bfb7c7ffd3fb36e083674 Mon Sep 17 00:00:00 2001 From: RyanZim Date: Wed, 26 Oct 2016 20:12:54 -0400 Subject: [PATCH] Warn about using preserveTimestamps on 32-bit node Fixes #269 --- lib/copy-sync/copy-sync.js | 6 ++++++ lib/copy/copy.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/copy-sync/copy-sync.js b/lib/copy-sync/copy-sync.js index 8168dee..a921597 100644 --- a/lib/copy-sync/copy-sync.js +++ b/lib/copy-sync/copy-sync.js @@ -18,6 +18,12 @@ function copySync (src, dest, options) { options.filter = options.filter || function () { return true } + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn('fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n' + + 'see https://github.com/jprichardson/node-fs-extra/issues/269') + } + var stats = (options.recursive && !options.dereference) ? fs.lstatSync(src) : fs.statSync(src) var destFolder = path.dirname(dest) var destFolderExists = fs.existsSync(destFolder) diff --git a/lib/copy/copy.js b/lib/copy/copy.js index d9d2912..6c5e224 100644 --- a/lib/copy/copy.js +++ b/lib/copy/copy.js @@ -13,6 +13,12 @@ function copy (src, dest, options, callback) { callback = callback || function () {} options = options || {} + // Warn about using preserveTimestamps on 32-bit node: + if (options.preserveTimestamps && process.arch === 'ia32') { + console.warn('fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n' + + 'see https://github.com/jprichardson/node-fs-extra/issues/269') + } + // don't allow src and dest to be the same var basePath = process.cwd() var currentPath = path.resolve(basePath, src)