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.
17 lines
319 B
17 lines
319 B
9 years ago
|
'use strict'
|
||
|
var fs = require('graceful-fs')
|
||
|
var SaveStack = require('./save-stack.js')
|
||
|
|
||
|
module.exports = rename
|
||
|
|
||
|
function rename (from, to, cb) {
|
||
|
var saved = new SaveStack(rename)
|
||
|
fs.rename(from, to, function (er) {
|
||
|
if (er) {
|
||
|
return cb(saved.completeWith(er))
|
||
|
} else {
|
||
|
return cb()
|
||
|
}
|
||
|
})
|
||
|
}
|