Mark qute-pass as executable and add checker

Regressed in #7068
This commit is contained in:
Florian Bruhin 2022-04-02 12:45:40 +02:00
parent 01a402dcfc
commit f7bf9d0c33
1 changed files with 5 additions and 1 deletions

View File

@ -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