Browse Source

Merge pull request #297 from jprichardson/32-bit

Warn about using preserveTimestamps on 32-bit node
ci/travis-osximage
JP Richardson 8 years ago
committed by GitHub
parent
commit
396c7acadb
  1. 6
      lib/copy-sync/copy-sync.js
  2. 6
      lib/copy/copy.js

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

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

Loading…
Cancel
Save