Merge luaML.love
This commit is contained in:
commit
e479baf449
10
live.lua
10
live.lua
|
@ -58,7 +58,8 @@ function live.load_files_so_far()
|
|||
end
|
||||
end
|
||||
end
|
||||
-- load files from save dir
|
||||
-- list files to load in save dir
|
||||
-- (ignore the repo because we might have deleted definitions)
|
||||
for _,filename in ipairs(love.filesystem.getDirectoryItems('')) do
|
||||
if io.open(love.filesystem.getSaveDirectory()..'/'..filename) then
|
||||
local numeric_prefix, root = filename:match('^(%d+)-(.+)')
|
||||
|
@ -70,17 +71,14 @@ function live.load_files_so_far()
|
|||
end
|
||||
end
|
||||
table.sort(Live.filenames_to_load)
|
||||
live.load_all(files)
|
||||
end
|
||||
|
||||
function live.load_all()
|
||||
-- load files from save dir
|
||||
for _,filename in ipairs(Live.filenames_to_load) do
|
||||
--? print('loading', filename)
|
||||
local buf = love.filesystem.read(filename)
|
||||
assert(buf and buf ~= '')
|
||||
local status, err = live.eval(buf)
|
||||
if not status then
|
||||
return err
|
||||
error(err)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue