bugfix: handle a missing save dir

Scenario:
  * run a whole new app (no save dir yet) as a .love file
  * open the driver, make an edit

Before this commit, I was seeing errors due to the save dir not
existing. Let's depend on love.filesystem as needed. Another "good seam"
IMO (https://lobste.rs/s/idi1wt/open_source_vs_ux).
This commit is contained in:
Kartik K. Agaram 2023-11-17 12:28:45 -08:00
parent efbceab81a
commit 375c7fe0db

View File

@ -225,7 +225,7 @@ function live.run(buf)
if err then
-- not possible; perhaps it's a .love file
-- try to write to save dir
local status, err2 = App.write_file(App.save_dir..filename, buf)
local status, err2 = love.filesystem.write(filename, buf)
if err2 then
-- throw an error
live.send_to_driver('ERROR '..tostring(err..'\n\n'..err2))