mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-07-07 12:32:54 +00:00

- Parenthesised expressions (function calls, arguments, etc...) should never have spaces in them. - Tables always will have spaces inside.
22 lines
457 B
Lua
22 lines
457 B
Lua
local tArgs = { ... }
|
|
if #tArgs < 2 then
|
|
print("Usage: rename <source> <destination>")
|
|
return
|
|
end
|
|
|
|
local sSource = shell.resolve(tArgs[1])
|
|
local sDest = shell.resolve(tArgs[2])
|
|
|
|
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)
|