depot/third_party/nixpkgs/pkgs/development/python-modules/pre-commit/hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch
Default email d7dbe45cea Project import generated by Copybara.
GitOrigin-RevId: 9480bae337095fd24f61380bce3174fdfe926a00
2020-06-18 09:06:33 +02:00

15 lines
565 B
Diff

diff --git a/pre_commit/resources/hook-tmpl b/pre_commit/resources/hook-tmpl
index 299144e..6d12543 100755
--- a/pre_commit/resources/hook-tmpl
+++ b/pre_commit/resources/hook-tmpl
@@ -25,8 +25,8 @@ ARGS.append('--')
ARGS.extend(sys.argv[1:])
DNE = '`pre-commit` not found. Did you forget to activate your virtualenv?'
-if os.access(INSTALL_PYTHON, os.X_OK):
- CMD = [INSTALL_PYTHON, '-mpre_commit']
+if os.access('@pre-commit@/bin/pre-commit', os.X_OK):
+ CMD = ['@pre-commit@/bin/pre-commit']
elif which('pre-commit'):
CMD = ['pre-commit']
else: