Fix misleading error message

The command given in the previous error message only changed the local script to executable. When running pre-commit the next time, it failed again with the same error message.

The new command actually changes the script in the repository to be executable, and pre-commit runs through the next time.

See also: <https://www.pixelninja.me/make-script-committed-to-git-executable/>.
This commit is contained in:
Thomas Aglassinger 2022-01-07 03:45:07 +01:00 committed by GitHub
parent 0d261aaf84
commit 49b52f4c97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,7 @@ def _message(path: str) -> None:
print(
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'`git update-index --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,