Skip to content

Commit

Permalink
Merge pull request #52 from Rummskartoffel/move-into-directory
Browse files Browse the repository at this point in the history
Fix move command trying to move files onto directories
  • Loading branch information
bovine3dom committed Sep 14, 2021
2 parents 9adba18 + 22308a3 commit dcd433f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/native_main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ proc handleMessage(msg: MessageRecv): MessageResp =
if result.code != some 0:
raise newException(OSError, "\"" & mvCmd & "\" failed on MacOS ...")
else:
moveFile(src, dst)
if dirExists dst:
moveFile(src, dst / extractFilename(src))
else:
moveFile(src, dst)
result.code = some(0)
except OSError:
result.code = some(2)
Expand Down

0 comments on commit dcd433f

Please sign in to comment.