diff options
-rw-r--r-- | scripts/dev/misc_checks.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/dev/misc_checks.py b/scripts/dev/misc_checks.py index 37c59d98f..05fdb7932 100644 --- a/scripts/dev/misc_checks.py +++ b/scripts/dev/misc_checks.py @@ -337,7 +337,7 @@ def check_userscripts_descriptions(_args: argparse.Namespace = None) -> bool: def check_userscript_shebangs(_args: argparse.Namespace) -> bool: - """Check that we're using /usr/bin/env in shebangs.""" + """Check that we're using /usr/bin/env in shebangs and scripts are executable.""" ok = True folder = pathlib.Path('misc/userscripts') @@ -345,6 +345,10 @@ def check_userscript_shebangs(_args: argparse.Namespace) -> bool: if sub.is_dir() or sub.name == 'README.md': continue + if not os.access(sub, os.X_OK): + print(f"{sub} is not marked as executable") + ok = False + with sub.open('r', encoding='utf-8') as f: shebang = f.readline().rstrip('\n') assert shebang.startswith('#!'), shebang |