Don't crash if there is no plugin directory

This commit is contained in:
Gnarwhal 2024-10-05 18:41:02 +00:00
parent 084ff6e503
commit ad51984991
Signed by: Gnarwhal
GPG key ID: 0989A73D8C421174

View file

@ -25,9 +25,12 @@ def default_config():
return _LOCATION / "config.toml" return _LOCATION / "config.toml"
def plugins(): def plugins():
return [ if (_LOCATION / "plugins").is_dir():
path for return [
path in path for
(_LOCATION / "plugins").iterdir() path in
if path.is_file() and path.suffix == ".py" (_LOCATION / "plugins").iterdir()
] if path.is_file() and path.suffix == ".py"
]
else:
return []