Skip to content

Commit

Permalink
Fix move command trying to move files onto directories
Browse files Browse the repository at this point in the history
Fixes #51
  • Loading branch information
Rummskartoffel committed Sep 13, 2021
1 parent 9adba18 commit 22308a3
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 22308a3

Please sign in to comment.