1
0
Fork 0
mirror of https://github.com/Oreolek/ink-instead.git synced 2024-07-08 01:24:39 +03:00

love filesystem file not found warning

This commit is contained in:
premek 2017-01-26 00:20:23 +01:00
parent 11d6fd7f00
commit 233ccbede7

View file

@ -6,7 +6,8 @@ local getParser = function () return require(folderOfThisFile .. 'parser') end
local runtime = require(folderOfThisFile .. 'runtime')
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
if love and love.filesystem then
if not love.filesystem.isFile(file) then error('failed to open "'..file..'"') end
local content, size = love.filesystem.read(file)
return content
else