mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-12-12 00:38:05 +00:00
Improve rename.lua's argument validation
This commit is contained in:
@@ -7,8 +7,15 @@ end
|
||||
local sSource = shell.resolve( tArgs[1] )
|
||||
local sDest = shell.resolve( tArgs[2] )
|
||||
|
||||
if fs.exists( sDest ) then
|
||||
if not fs.exists( sSource ) then
|
||||
printError( "No matching files" )
|
||||
return
|
||||
elseif fs.exists( sDest ) then
|
||||
printError( "Destination exists" )
|
||||
return
|
||||
elseif fs.isReadOnly( sDest ) then
|
||||
printError( "Destination is read-only" )
|
||||
return
|
||||
end
|
||||
|
||||
fs.move( sSource, sDest )
|
||||
|
||||
Reference in New Issue
Block a user