1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-04-22 18:53:16 +00:00

Fix Bug in copy.lua, mkdir.lua and rename.lua

This commit is contained in:
Wilma456 2017-08-09 19:32:29 +02:00
parent 579f7443a8
commit 90c4ebd208
3 changed files with 14 additions and 1 deletions

View File

@ -10,7 +10,9 @@ local sDest = shell.resolve( tArgs[2] )
local tFiles = fs.find( sSource )
if #tFiles > 0 then
for n,sFile in ipairs( tFiles ) do
if fs.isDir( sDest ) then
if fs.exists( sDest ) == true then
printError( "Destination exists" )
elseif fs.isDir( sDest ) then
fs.copy( sFile, fs.combine( sDest, fs.getName(sFile) ) )
elseif #tFiles == 1 then
fs.copy( sFile, sDest )

View File

@ -5,5 +5,11 @@ if #tArgs < 1 then
end
local sNewDir = shell.resolve( tArgs[1] )
if fs.exists( sNewDir ) == true then
printError( "Destination exists" )
return
end
fs.makeDir( sNewDir )

View File

@ -6,4 +6,9 @@ end
local sSource = shell.resolve( tArgs[1] )
local sDest = shell.resolve( tArgs[2] )
if fs.exists( sDest ) == true then
printError( "Destination exists" )
end
fs.move( sSource, sDest )