port hook template to bash

this avoids some version-specific code in python

this also makes the bootstrap script slightly more portable
This commit is contained in:
Anthony Sottile 2021-09-27 19:34:04 -04:00
parent ef7b126ee3
commit e622f793c3
3 changed files with 20 additions and 49 deletions

View file

@ -278,11 +278,7 @@ def test_environment_not_sourced(tempdir_factory, store):
hook = os.path.join(path, '.git/hooks/pre-commit')
with open(hook) as f:
src = f.read()
src = re.sub(
'\nINSTALL_PYTHON =.*\n',
'\nINSTALL_PYTHON = "/dne"\n',
src,
)
src = re.sub('\nINSTALL_PYTHON=.*\n', '\nINSTALL_PYTHON="/dne"\n', src)
with open(hook, 'w') as f:
f.write(src)