mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-13 03:30:29 +00:00
Merge pull request #411 from Wilma456/copyfixup
Fix Bug in copy.lua, mkdir.lua and rename.lua (updated)
This commit is contained in:
commit
f30c4f16c0
@ -13,7 +13,11 @@ if #tFiles > 0 then
|
||||
if fs.isDir( sDest ) then
|
||||
fs.copy( sFile, fs.combine( sDest, fs.getName(sFile) ) )
|
||||
elseif #tFiles == 1 then
|
||||
fs.copy( sFile, sDest )
|
||||
if fs.exists( sDest ) then
|
||||
printError( "Destination exists" )
|
||||
else
|
||||
fs.copy( sFile, sDest )
|
||||
end
|
||||
else
|
||||
printError( "Cannot overwrite file multiple times" )
|
||||
return
|
||||
|
@ -5,5 +5,11 @@ if #tArgs < 1 then
|
||||
end
|
||||
|
||||
local sNewDir = shell.resolve( tArgs[1] )
|
||||
|
||||
if fs.exists( sNewDir ) and not fs.isDir(sNewDir) then
|
||||
printError( "Destination exists" )
|
||||
return
|
||||
end
|
||||
|
||||
fs.makeDir( sNewDir )
|
||||
|
||||
|
@ -6,4 +6,9 @@ end
|
||||
|
||||
local sSource = shell.resolve( tArgs[1] )
|
||||
local sDest = shell.resolve( tArgs[2] )
|
||||
|
||||
if fs.exists( sDest ) then
|
||||
printError( "Destination exists" )
|
||||
end
|
||||
|
||||
fs.move( sSource, sDest )
|
||||
|
Loading…
Reference in New Issue
Block a user