def install(<EOL>config_file, store,<EOL>overwrite=False, hooks=False, hook_type='<STR_LIT>',<EOL>skip_on_missing_conf=False,<EOL>):
if cmd_output('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', retcode=None)[<NUM_LIT:1>].strip():<EOL><INDENT>logger.error(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>',<EOL>)<EOL>return <NUM_LIT:1><EOL><DEDENT>hook_path, legacy_path = _hook_paths(hook_type)<EOL>mkdirp(os.path.dirname(hook_path))<EOL>if os.path.lexists(hook_path) and not is_our_script(hook_path):<EOL><INDENT>shutil.move(hook_path, legacy_path)<EOL><DEDENT>if overwrite and os.path.exists(legacy_path):<EOL><INDENT>os.remove(legacy_path)<EOL><DEDENT>elif os.path.exists(legacy_path):<EOL><INDENT>output.write_line(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(legacy_path),<EOL>)<EOL><DEDENT>params = {<EOL>'<STR_LIT>': config_file,<EOL>'<STR_LIT>': hook_type,<EOL>'<STR_LIT>': sys.executable,<EOL>'<STR_LIT>': skip_on_missing_conf,<EOL>}<EOL>with io.open(hook_path, '<STR_LIT:w>') as hook_file:<EOL><INDENT>contents = resource_text('<STR_LIT>')<EOL>before, rest = contents.split(TEMPLATE_START)<EOL>to_template, after = rest.split(TEMPLATE_END)<EOL>before = before.replace('<STR_LIT>', shebang())<EOL>hook_file.write(before + TEMPLATE_START)<EOL>for line in to_template.splitlines():<EOL><INDENT>var = line.split()[<NUM_LIT:0>]<EOL>hook_file.write('<STR_LIT>'.format(var, params[var]))<EOL><DEDENT>hook_file.write(TEMPLATE_END + after)<EOL><DEDENT>make_executable(hook_path)<EOL>output.write_line('<STR_LIT>'.format(hook_path))<EOL>if hooks:<EOL><INDENT>install_hooks(config_file, store)<EOL><DEDENT>return <NUM_LIT:0><EOL>
Install the pre-commit hooks.