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 3, 2017
1 parent e771770 commit 50ecc8f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/move/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ function move (source, dest, options, callback) {
}

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

Expand Down

0 comments on commit 50ecc8f

Please sign in to comment.