persistent-evdev icon indicating copy to clipboard operation
persistent-evdev copied to clipboard

Caching capabilities doesnt check if directory exist

Open Ghibranalj opened this issue 7 months ago • 0 comments

I love your tool but i found an (nitpicky) issue. when i misconfigured my config.json to use a directory that doesnt exist

  "cache": "/doesnt/exist/cache"

this error occurs

File "/opt/persistent-evdev/bin/persistent-evdev.py", line 74, in save_capabilities
  with open(capabilities_path, "w+") as file:
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/doesnt/exist/cache/device.json'

it would be nice if

make_capabilities_path(self)

also check if the directory exist and if not it would create it

Ghibranalj avatar Dec 10 '23 22:12 Ghibranalj