From 375c7fe0dbdddc8c2269c702424589366f58c4c6 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Fri, 17 Nov 2023 12:28:45 -0800 Subject: [PATCH] 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). --- live.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/live.lua b/live.lua index 071d491..5f48e6e 100644 --- a/live.lua +++ b/live.lua @@ -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))