Skip to content

Commit

Permalink
Don't move when source and dest paths are the same.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Mar 6, 2017
1 parent e771770 commit b74cf5b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/move/index.js
Expand Up @@ -35,7 +35,9 @@ function move (source, dest, options, callback) {
}

function doRename () {
if (overwrite) {
if (path.resolve(source) === path.resolve(dest)) {
setImmediate(callback)
} else if (overwrite) {
fs.rename(source, dest, err => {
if (!err) return callback()

Expand Down

0 comments on commit b74cf5b

Please sign in to comment.