Skip to content

Commit 16bc739

Browse files
committed
Suggest usable call when exec files lack shebang on Windows
Resolves Issue #686
1 parent 56b4a7e commit 16bc739

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pre_commit_hooks/check_executables_have_shebangs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def _message(path: str) -> None:
6464
f'{path}: marked executable but has no (or invalid) shebang!\n'
6565
f" If it isn't supposed to be executable, try: "
6666
f'`chmod -x {shlex.quote(path)}`\n'
67+
f' If on Windows, you may also need to: '
68+
f'`git add --chmod=-x {shlex.quote(path)}`\n'
6769
f' If it is supposed to be executable, double-check its shebang.',
6870
file=sys.stderr,
6971
)

0 commit comments

Comments
 (0)