v0.6.0 - Added shell parser, echo command and some other minor tweaks.

This commit is contained in:
TheWahlolly
2025-04-26 12:38:05 +03:00
parent d220b9d648
commit 64a761fdde
7 changed files with 90 additions and 11 deletions
+10 -2
View File
@@ -11,7 +11,7 @@ local filesystem = {}
function filesystem.processPath(path) -- returns the address and absolute path of a filesystem path as well as sanitizing it
checkArg(1, path, "string")
absPath = path:gsub("/+", "/"):gsub("/$", "")
absPath = path:gsub("/+", "/")
local address = nil
if absPath:find("^/mnt/.../") then
address = component.get(path:sub(6,8))
@@ -66,4 +66,12 @@ function filesystem.open(path, mode) -- opens a file and returns its handle
return properHandle
end
return(filesystem)
function filesystem.list(path)
checkArg(1, path, "string")
local address, absPath = filesystem.processPath(path)
if not address then
return false
end
return component.invoke(address, "list", absPath)
end
return(filesystem)