bugfix: roll back on load error

This commit is contained in:
Kartik K. Agaram 2023-01-07 19:12:26 -08:00
parent eb0079ef87
commit ada035f0bc
1 changed files with 1 additions and 0 deletions

View File

@ -260,6 +260,7 @@ function live.run(buf)
if not status then
-- roll back
Live.head = Live.manifest[PARENT]
love.filesystem.write('head', tostring(Live.head))
local previous_manifest_filename = live.versioned_manifest(Live.head)
Live.manifest = json.decode(love.filesystem.read(previous_manifest_filename))
-- throw an error