opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
pre_commit
/
commands
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
[DIR] __pycache__
N/A
__init__.py
0 bytes
Rename
Delete
autoupdate.py
6.99 KB
Rename
Delete
clean.py
429 bytes
Rename
Delete
gc.py
2.74 KB
Rename
Delete
hook_impl.py
9.18 KB
Rename
Delete
init_templatedir.py
1.11 KB
Rename
Delete
install_uninstall.py
5.22 KB
Rename
Delete
migrate_config.py
4.06 KB
Rename
Delete
run.py
13.78 KB
Rename
Delete
sample_config.py
453 bytes
Rename
Delete
try_repo.py
2.52 KB
Rename
Delete
validate_config.py
371 bytes
Rename
Delete
validate_manifest.py
377 bytes
Rename
Delete
from __future__ import annotations import logging import os.path from pre_commit.commands.install_uninstall import install from pre_commit.store import Store from pre_commit.util import CalledProcessError from pre_commit.util import cmd_output logger = logging.getLogger('pre_commit') def init_templatedir( config_file: str, store: Store, directory: str, hook_types: list[str] | None, skip_on_missing_config: bool = True, ) -> int: install( config_file, store, hook_types=hook_types, overwrite=True, skip_on_missing_config=skip_on_missing_config, git_dir=directory, ) try: _, out, _ = cmd_output('git', 'config', 'init.templateDir') except CalledProcessError: configured_path = None else: configured_path = os.path.realpath(os.path.expanduser(out.strip())) dest = os.path.realpath(directory) if configured_path != dest: logger.warning('`init.templateDir` not set to the target directory') logger.warning(f'maybe `git config --global init.templateDir {dest}`?') return 0
Save