diff --git a/app.lua b/app.lua index f374619..6c7dc3b 100644 --- a/app.lua +++ b/app.lua @@ -129,6 +129,7 @@ function love.run() return --[[status]] true end App.files = love.filesystem.getDirectoryItems + App.file_info = love.filesystem.getInfo App.mkdir = love.filesystem.createDirectory App.remove = love.filesystem.remove App.source_dir = love.filesystem.getSource()..'/' -- '/' should work even on Windows diff --git a/live.lua b/live.lua index 2c11363..d199045 100644 --- a/live.lua +++ b/live.lua @@ -163,7 +163,7 @@ function live.run(buf) live.eval(definition_name..' = nil', 'driver') -- ignore errors which will likely be from keywords like `function = nil` -- try to remove the file from both source_dir and save_dir -- this won't work for files inside .love files - App.remove(App.source_dir..Live.filename[definition_name]) + nativefs.remove(App.source_dir..Live.filename[definition_name]) love.filesystem.remove(Live.filename[definition_name]) Live.filename[definition_name] = nil end @@ -221,10 +221,9 @@ function live.run(buf) Live.filename[definition_name] = filename end -- try to write to source dir - local status, err = App.write_file(App.source_dir..filename, buf) + local status, err = nativefs.write(App.source_dir..filename, buf) if err then - -- not possible; perhaps it's a .love file - -- try to write to save dir + -- fall back on save dir local status, err2 = love.filesystem.write(filename, buf) if err2 then -- throw an error