@@ -9285,8 +9285,11 @@ function copySync (src, dest, opts) {
92859285
92869286 // Warn about using preserveTimestamps on 32-bit node
92879287 if (opts.preserveTimestamps && process.arch === 'ia32') {
9288- console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
9289- see https://github.com/jprichardson/node-fs-extra/issues/269`)
9288+ process.emitWarning(
9289+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
9290+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
9291+ 'Warning', 'fs-extra-WARN0002'
9292+ )
92909293 }
92919294
92929295 const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
@@ -9465,8 +9468,11 @@ function copy (src, dest, opts, cb) {
94659468
94669469 // Warn about using preserveTimestamps on 32-bit node
94679470 if (opts.preserveTimestamps && process.arch === 'ia32') {
9468- console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
9469- see https://github.com/jprichardson/node-fs-extra/issues/269`)
9471+ process.emitWarning(
9472+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
9473+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
9474+ 'Warning', 'fs-extra-WARN0001'
9475+ )
94709476 }
94719477
94729478 stat.checkPaths(src, dest, 'copy', opts, (err, stats) => {
@@ -10214,7 +10220,6 @@ Object.assign(exports, fs)
1021410220api.forEach(method => {
1021510221 exports[method] = u(fs[method])
1021610222})
10217- exports.realpath.native = u(fs.realpath.native)
1021810223
1021910224// We differ from mz/fs in that we still ship the old, broken, fs.exists()
1022010225// since we are a drop-in replacement for the native module
@@ -10278,6 +10283,16 @@ if (typeof fs.writev === 'function') {
1027810283 }
1027910284}
1028010285
10286+ // fs.realpath.native sometimes not available if fs is monkey-patched
10287+ if (typeof fs.realpath.native === 'function') {
10288+ exports.realpath.native = u(fs.realpath.native)
10289+ } else {
10290+ process.emitWarning(
10291+ 'fs.realpath.native is not a function. Is fs being monkey-patched?',
10292+ 'Warning', 'fs-extra-WARN0003'
10293+ )
10294+ }
10295+
1028110296
1028210297/***/ }),
1028310298
@@ -10571,6 +10586,8 @@ function move (src, dest, opts, cb) {
1057110586 opts = {}
1057210587 }
1057310588
10589+ opts = opts || {}
10590+
1057410591 const overwrite = opts.overwrite || opts.clobber || false
1057510592
1057610593 stat.checkPaths(src, dest, 'move', opts, (err, stats) => {
0 commit comments