1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-01-27 09:24:47 +00:00

Changes requested by dan200

This commit is contained in:
Wilma456 2017-09-12 20:43:07 +02:00
parent 90c4ebd208
commit 1415dd0dae
3 changed files with 8 additions and 6 deletions

View File

@ -10,12 +10,14 @@ local sDest = shell.resolve( tArgs[2] )
local tFiles = fs.find( sSource ) local tFiles = fs.find( sSource )
if #tFiles > 0 then if #tFiles > 0 then
for n,sFile in ipairs( tFiles ) do for n,sFile in ipairs( tFiles ) do
if fs.exists( sDest ) == true then if fs.isDir( sDest ) then
printError( "Destination exists" )
elseif fs.isDir( sDest ) then
fs.copy( sFile, fs.combine( sDest, fs.getName(sFile) ) ) fs.copy( sFile, fs.combine( sDest, fs.getName(sFile) ) )
elseif #tFiles == 1 then elseif #tFiles == 1 then
if fs.exists( sDest ) then
printError( "Destination exists" )
else
fs.copy( sFile, sDest ) fs.copy( sFile, sDest )
end
else else
printError( "Cannot overwrite file multiple times" ) printError( "Cannot overwrite file multiple times" )
return return

View File

@ -6,7 +6,7 @@ end
local sNewDir = shell.resolve( tArgs[1] ) local sNewDir = shell.resolve( tArgs[1] )
if fs.exists( sNewDir ) == true then if fs.exists( sNewDir ) then
printError( "Destination exists" ) printError( "Destination exists" )
return return
end end

View File

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