gracefully handle a read-only config file location
This commit is contained in:
parent
36c6859abf
commit
f87191c4ae
@ -50,5 +50,10 @@ f:close()
|
|||||||
print("\nDone! Saving config...")
|
print("\nDone! Saving config...")
|
||||||
|
|
||||||
local f = io.open(cfgpath, "wb")
|
local f = io.open(cfgpath, "wb")
|
||||||
|
if f then
|
||||||
f:write(serial.serialize(config))
|
f:write(serial.serialize(config))
|
||||||
f:close()
|
f:close()
|
||||||
|
else
|
||||||
|
print("Failed to save config. Lost contents:")
|
||||||
|
print(serial.serialize(config))
|
||||||
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user