save_variables: Verify filename path is writeable at startup
Signed-off-by: Justin Schuh <code@justinschuh.com>
This commit is contained in:
parent
ba365aff96
commit
201f715b55
|
@ -12,6 +12,8 @@ class SaveVariables:
|
||||||
self.filename = os.path.expanduser(config.get('filename'))
|
self.filename = os.path.expanduser(config.get('filename'))
|
||||||
self.allVariables = {}
|
self.allVariables = {}
|
||||||
try:
|
try:
|
||||||
|
if not os.path.exists(self.filename):
|
||||||
|
open(self.filename, "w").close()
|
||||||
self.loadVariables()
|
self.loadVariables()
|
||||||
except self.printer.command_error as e:
|
except self.printer.command_error as e:
|
||||||
raise config.error(str(e))
|
raise config.error(str(e))
|
||||||
|
|
Loading…
Reference in New Issue