From ccad15ecf78c572e5b5240fcd69d100eb78ce26c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=A4der?= Date: Tue, 2 Jun 2020 13:37:57 +0200 Subject: [PATCH] Don't try to run non-python files --- startup_scripts/__main__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/startup_scripts/__main__.py b/startup_scripts/__main__.py index 343ca95..c41bba6 100644 --- a/startup_scripts/__main__.py +++ b/startup_scripts/__main__.py @@ -11,7 +11,13 @@ def filename(f): with scandir(dirname(abspath(__file__))) as it: for f in sorted(it, key = filename): - if f.name.startswith('__') or not f.is_file(): + if not f.is_file(): + continue + + if f.name.startswith('__'): + continue + + if not f.name.endswith('.py'): continue print(f"▶️ Running the startup script {f.path}")