mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
432 B
20 lines
432 B
8 years ago
|
'use strict'
|
||
|
module.exports = wrappedMove
|
||
|
|
||
|
var fs = require('graceful-fs')
|
||
|
var move = require('move-concurrently')
|
||
|
var Bluebird = require('bluebird')
|
||
|
|
||
|
function wrappedMove (from, to, cb) {
|
||
|
var movePromise = move(from, to, {fs: fs, Promise: Bluebird, maxConcurrency: 4})
|
||
|
if (cb) {
|
||
|
return movePromise.then(function (value) {
|
||
|
cb(value)
|
||
|
}, function (err) {
|
||
|
cb(err)
|
||
|
})
|
||
|
} else {
|
||
|
return movePromise
|
||
|
}
|
||
|
}
|