微调del命令相关代码
This commit is contained in:
@@ -90,9 +90,9 @@ do--commands.help(arg)
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
del={
|
del={
|
||||||
description="Attempt to delete a file (in saving directory)",
|
description="Attempt to delete a file or directory",
|
||||||
details={
|
details={
|
||||||
"Attempt to delete a file (in saving directory)",
|
"Attempt to delete a file or directory (in saving directory)",
|
||||||
"",
|
"",
|
||||||
"Aliases: rm",
|
"Aliases: rm",
|
||||||
"",
|
"",
|
||||||
@@ -380,10 +380,10 @@ do--function commands.del(name)
|
|||||||
local info=love.filesystem.getInfo(name)
|
local info=love.filesystem.getInfo(name)
|
||||||
if info then
|
if info then
|
||||||
if info.type=='file'then
|
if info.type=='file'then
|
||||||
if recursive then
|
if not recursive then
|
||||||
log{C.R,name.." is not a directory."}
|
|
||||||
else
|
|
||||||
delFile(name)
|
delFile(name)
|
||||||
|
else
|
||||||
|
log{C.R,("'%s' is not a directory."):format(name)}
|
||||||
end
|
end
|
||||||
elseif info.type=='directory'then
|
elseif info.type=='directory'then
|
||||||
(recursive and recursiveDelDir or delDir)(name)
|
(recursive and recursiveDelDir or delDir)(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user