mirror of
https://github.com/Oreolek/ink-instead.git
synced 2024-07-16 21:44:38 +03:00
.love file packaging support
This commit is contained in:
parent
0ef5f2227c
commit
b9a7c2e73c
|
@ -3,13 +3,18 @@ local parser = require(folderOfThisFile .. 'parser')
|
|||
local runtime = require(folderOfThisFile .. 'runtime')
|
||||
|
||||
|
||||
local function read(file)
|
||||
local function read(file) -- TODO should this be here or in client code? At lease allow to pass an ink content in a string
|
||||
if love and love.filesystem and love.filesystem.read then
|
||||
local content, size = love.filesystem.read(file)
|
||||
return content
|
||||
else
|
||||
local f = io.open(file, "rb")
|
||||
if not f then error('failed to open "'..file..'"') end
|
||||
local content = f:read("*all")
|
||||
f:close()
|
||||
return content
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue