Skip to content

Commit

Permalink
Suggest usable chmod on Windows (2)
Browse files Browse the repository at this point in the history
Follow-up for pre-commit#686 and pre-commit#689.

The previous change resolved when a file was executable but lacked
a shebang, but not vice-versa.
  • Loading branch information
jmerdich committed Dec 13, 2021
1 parent ccecdbd commit 4857e1c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pre_commit_hooks/check_shebang_scripts_are_executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def _message(path: str) -> None:
f'{path}: has a shebang but is not marked executable!\n'
f' If it is supposed to be executable, try: '
f'`chmod +x {shlex.quote(path)}`\n'
f' If on Windows, you may also need to: '
f'`git add --chmod=+x {shlex.quote(path)}`\n'
f' If it not supposed to be executable, double-check its shebang '
f'is wanted.\n',
file=sys.stderr,
Expand Down

0 comments on commit 4857e1c

Please sign in to comment.