mirror of
https://github.com/sezanzeb/input-remapper
synced 2024-11-18 03:25:52 +00:00
fixed config file doesnt exist
This commit is contained in:
parent
22325c0c8d
commit
74e98e28df
@ -87,6 +87,11 @@ class _Config:
|
|||||||
|
|
||||||
def save_config(self):
|
def save_config(self):
|
||||||
"""Save the config to the file system."""
|
"""Save the config to the file system."""
|
||||||
|
if not os.path.exists(CONFIG_PATH):
|
||||||
|
logger.debug('Creating "%s"', CONFIG_PATH)
|
||||||
|
os.makedirs(os.path.dirname(CONFIG_PATH), exist_ok=True)
|
||||||
|
os.mknod(CONFIG_PATH)
|
||||||
|
|
||||||
with open(CONFIG_PATH, 'w') as f:
|
with open(CONFIG_PATH, 'w') as f:
|
||||||
json.dump(self._config, f, indent=4)
|
json.dump(self._config, f, indent=4)
|
||||||
logger.info('Saved config to %s', CONFIG_PATH)
|
logger.info('Saved config to %s', CONFIG_PATH)
|
||||||
|
Loading…
Reference in New Issue
Block a user