1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-07-02 10:03:32 +00:00
CC-Tweaked/src/main/resources/assets/computercraft/lua/rom/programs/delete.lua

17 lines
303 B
Lua
Raw Normal View History

local tArgs = { ... }
if #tArgs < 1 then
print( "Usage: rm <path>" )
return
end
local sPath = shell.resolve( tArgs[1] )
local tFiles = fs.find( sPath )
if #tFiles > 0 then
for n,sFile in ipairs( tFiles ) do
fs.delete( sFile )
end
else
printError( "No matching files" )
end