def install_hook(name, path, wrapper_command):
    logger = output.get_sub_logger('manager-install', 'install_hook')
    logger.debug('Installing %s hook.', name)
    if not path.exists() or click.confirm('{} hook already exists. Do you want to overwrite it?'.format(name)):
        with path.open('wb+') as pre_commit_hook:
            pre_commit_hook.write(wrapper_command.encode('utf-8'))
        path.chmod(0o755)  # -rwxr-xr-x
        logger.info('Installed %s hook', name)
    else:
        logger.info('Skipped %s hook installation.', name)
Installs a hook in path
dataset/ETHPy150Open zalando/turnstile/turnstile/manager_subcommands/install.py/install_hook