parent
01a402dcfc
commit
f7bf9d0c33
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue