aboutsummaryrefslogtreecommitdiff
path: root/node_modules/fs-extra/lib/move
diff options
context:
space:
mode:
authorPriyansh <[email protected]>2020-12-22 17:50:12 +0530
committerPriyansh <[email protected]>2020-12-22 17:50:12 +0530
commit22dc033f4938d6a19e086a1cbd36ec5cade5eaab (patch)
tree9feb963ccd5c1581e676e41004801abc67db3357 /node_modules/fs-extra/lib/move
parente93da8b04da86773247aadb1cbb1912e4f4526b2 (diff)
downloadstyx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.tar.xz
styx-22dc033f4938d6a19e086a1cbd36ec5cade5eaab.zip
Remove node_modules
Diffstat (limited to 'node_modules/fs-extra/lib/move')
-rw-r--r--node_modules/fs-extra/lib/move/index.js6
-rw-r--r--node_modules/fs-extra/lib/move/move.js65
2 files changed, 0 insertions, 71 deletions
diff --git a/node_modules/fs-extra/lib/move/index.js b/node_modules/fs-extra/lib/move/index.js
deleted file mode 100644
index 3785345..0000000
--- a/node_modules/fs-extra/lib/move/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict'
-
-const u = require('universalify').fromCallback
-module.exports = {
- move: u(require('./move'))
-}
diff --git a/node_modules/fs-extra/lib/move/move.js b/node_modules/fs-extra/lib/move/move.js
deleted file mode 100644
index fa3ea61..0000000
--- a/node_modules/fs-extra/lib/move/move.js
+++ /dev/null
@@ -1,65 +0,0 @@
-'use strict'
-
-const fs = require('graceful-fs')
-const path = require('path')
-const copy = require('../copy').copy
-const remove = require('../remove').remove
-const mkdirp = require('../mkdirs').mkdirp
-const pathExists = require('../path-exists').pathExists
-const stat = require('../util/stat')
-
-function move (src, dest, opts, cb) {
- if (typeof opts === 'function') {
- cb = opts
- opts = {}
- }
-
- const overwrite = opts.overwrite || opts.clobber || false
-
- stat.checkPaths(src, dest, 'move', (err, stats) => {
- if (err) return cb(err)
- const { srcStat } = stats
- stat.checkParentPaths(src, srcStat, dest, 'move', err => {
- if (err) return cb(err)
- mkdirp(path.dirname(dest), err => {
- if (err) return cb(err)
- return doRename(src, dest, overwrite, cb)
- })
- })
- })
-}
-
-function doRename (src, dest, overwrite, cb) {
- if (overwrite) {
- return remove(dest, err => {
- if (err) return cb(err)
- return rename(src, dest, overwrite, cb)
- })
- }
- pathExists(dest, (err, destExists) => {
- if (err) return cb(err)
- if (destExists) return cb(new Error('dest already exists.'))
- return rename(src, dest, overwrite, cb)
- })
-}
-
-function rename (src, dest, overwrite, cb) {
- fs.rename(src, dest, err => {
- if (!err) return cb()
- if (err.code !== 'EXDEV') return cb(err)
- return moveAcrossDevice(src, dest, overwrite, cb)
- })
-}
-
-function moveAcrossDevice (src, dest, overwrite, cb) {
- const opts = {
- overwrite,
- errorOnExist: true
- }
- copy(src, dest, opts, err => {
- if (err) return cb(err)
- return remove(src, cb)
- })
-}
-
-module.exports = move