Warn about using preserveTimestamps on 32-bit node

Fixes #269
This commit is contained in:
RyanZim 2016-10-26 20:12:54 -04:00
parent 89aeac2e04
commit 0e0fcb88dc
2 changed files with 12 additions and 0 deletions

View File

@ -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)

View File

@ -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)