22 lines
644 B
Luau
22 lines
644 B
Luau
--!strict
|
|
-- host/Luau: the Luau CLI (and any embedding without io): no file system. Sources are buffers or strings.
|
|
local Err = require("@rosetta/core/Err")
|
|
|
|
local Host = {}
|
|
Host.name = "luau"
|
|
Host.hasFiles = false
|
|
|
|
function Host.readFile(path: string): (buffer?, Err.Err?)
|
|
return nil, Err.new(Err.IO, "no file system on this host (luau): pass a buffer or a string, not the path " .. path)
|
|
end
|
|
|
|
function Host.writeFile(path: string, _data: buffer): (boolean, Err.Err?)
|
|
return false, Err.new(Err.IO, "no file system on this host (luau): cannot write " .. path)
|
|
end
|
|
|
|
function Host.exists(_path: string): boolean
|
|
return false
|
|
end
|
|
|
|
return Host
|