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():
if (_LOCATION / "plugins").is_dir():
return [ return [
path for path for
path in path in
(_LOCATION / "plugins").iterdir() (_LOCATION / "plugins").iterdir()
if path.is_file() and path.suffix == ".py" if path.is_file() and path.suffix == ".py"
] ]
else:
return []