1From d9e6999e32112602ec276634cb004eda3ca64ec3 Mon Sep 17 00:00:00 2001
2From: "Wael M. Nasreddine" <wael.nasreddine@gmail.com>
3Date: Mon, 13 Jan 2020 11:04:58 -0800
4Subject: [PATCH] hook-tmpl: use the hardcoded path to pre-commit, if found
5
6---
7 pre_commit/resources/hook-tmpl | 2 ++
8 1 file changed, 2 insertions(+)
9
10diff --git a/pre_commit/resources/hook-tmpl b/pre_commit/resources/hook-tmpl
11index 213d16e..3a99211 100755
12--- a/pre_commit/resources/hook-tmpl
13+++ b/pre_commit/resources/hook-tmpl
14@@ -107,6 +107,8 @@ def _exe() -> Tuple[str, ...]:
15 except OSError:
16 pass
17
18+ if os.path.isfile('@pre-commit@/bin/pre-commit') and os.access('@pre-commit@/bin/pre-commit', os.X_OK):
19+ return ('@pre-commit@/bin/pre-commit', 'run')
20 if distutils.spawn.find_executable('pre-commit'):
21 return ('pre-commit', 'run')
22
23--
242.23.1
25