@invoke.task
def hooks(arg):
    invoke_path = Path(arg.run('which invoke', hide=True).stdout[:(- 1)])
    for src_path in Path('.hooks').iterdir():
        dst_path = (Path('.git/hooks') / src_path.name)
        print(f'Installing: {dst_path}')
        with open(str(src_path), 'r') as f:
            src_data = f.read()
        with open(str(dst_path), 'w') as f:
            f.write(src_data.format(invoke_path=invoke_path.parent))
        arg.run(f'chmod +x {dst_path}')
@invoke.task
def hooks(arg):
    invoke_path = Path(arg.run('which invoke', hide=True).stdout[:(- 1)])
    for src_path in Path('.hooks').iterdir():
        dst_path = (Path('.git/hooks') / src_path.name)
        print(f'Installing: {dst_path}')
        with open(str(src_path), 'r') as f:
            src_data = f.read()
        with open(str(dst_path), 'w') as f:
            f.write(src_data.format(invoke_path=invoke_path.parent))
        arg.run(f'chmod +x {dst_path}')