Viewing File: /opt/hc_python/lib/python3.12/site-packages/pre_commit/__pycache__/store.cpython-312.pyc
�
i0i! � � � d dl mZ d dlZd dlZd dlZd dlZd dlZd dlm Z d dlm
Z
d dlmZ d dlm
Z d dlmZ d dlmZ d dlmZ d d lmZ d d
lmZ d dlmZ d dlmZ ej0 d
� Zdd�ZdZdd�Z G d� d� Zy)� )�annotationsN)�Callable)� Generator)�Sequence)� clientlib)� file_lock)�git)�CalledProcessError)�clean_path_on_failure��cmd_output_b)�
resource_text�
pre_commitc �> � t j j d� xs^ t j j t j j d� xs t j j d� d� } t j j
| � S )a7 Returns the default directory for the Store. This is intentionally
underscored to indicate that `Store.get_default_directory` is the intended
way to get this information. This is also done so
`Store.get_default_directory` can be mocked in tests and
`_get_default_directory` can be tested.
�PRE_COMMIT_HOME�XDG_CACHE_HOMEz~/.cachez
pre-commit)�os�environ�get�path�join�
expanduser�realpath)�rets �?/opt/hc_python/lib/python3.12/site-packages/pre_commit/store.py�_get_default_directoryr sj � �
�*�*�.�.�*�
+� �r�w�w�|�|�
�
�
���'�(�J�B�G�G�,>�,>�z�,J��0�C� �7�7���C� � � )z
Cargo.tomlzmain.gozgo.modzmain.rsz
.npmignorezpackage.jsonz!pre-commit-package-dev-1.rockspecz&pre_commit_placeholder_package.gemspeczsetup.pyzenvironment.ymlzMakefile.PLzpubspec.yamlz renv.lockzrenv/activate.Rzrenv/LICENSE.renvc � � t D ]� }t j j |� \ }}t d|� �� }t j j | |� }t j j ||� }t j |d�� t |d� 5 }|j |� d d d � �� y # 1 sw Y ��xY w)N�empty_template_T��exist_ok�w) �_LOCAL_RESOURCESr r �splitr r �makedirs�open�write)� directory�resource�resource_dirname�resource_basename�contents�
target_dir�target_file�fs r �_make_local_repor0 0 s� � �$��.0�g�g�m�m�H�.E�+��+� �?�3D�2E�!F�G���W�W�\�\�)�-=�>�
��g�g�l�l�:�/@�A��
���J��.�
�+�s�
#�q�
�G�G�H�� $�
#�
%� $�
#�s �B:�:C c �� � e Zd Z ee� Zd
dd�Zej dd�� Z ej d
dd�� Z
edd�� Z dd�Z
dd�Zdd�Zddd �Zdd
�Zdd�Zdd�Zy)�StoreNc �� � |xs t j � | _ t j j | j d� | _ t j j | j � xr/ t j | j t j � | _
t j j | j � sot j | j d�� t t j j | j d� d� 5 }|j d� d d d � t j j | j � ry | j � 5 t j j | j � r
d d d � y t j | j �� \ }}t j"