관리-도구
편집 파일: haskell.cpython-38.pyc
U ,�ex � @ s� d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z d dl mZ d dl mZ d dl m Z d d lmZ d d lmZ dZe jZe jZe jZdd d�dd�Zejdddd�dd��Zddddd�dd�ZdS )� )�annotationsN)� Generator)�Sequence)� lang_base)� envcontext)�PatchesT)�Var)� FatalError)�PrefixZhs_env�strr )� target_dir�returnc C s$ t j�| d�}d|t jtd�fffS )N�bin�PATH)�os�path�join�pathsepr )r Zbin_path� r �J/opt/hc_python/lib/python3.8/site-packages/pre_commit/languages/haskell.py� get_env_patch s r r zGenerator[(None, None, None)])�prefix�versionr c c s0 t �| t|�}tt|��� d V W 5 Q R X d S )N)r �environment_dir�ENVIRONMENT_DIRr r )r r �envdirr r r �in_env s r z Sequence[str]�None)r r �additional_dependenciesr c C s| t �d|� t �| t|�}| �d�|�}|s4td��tj�|d�}tj |dd� t � | d� t � | dd d dd|f|�� d S ) N�haskellz.cabalz0Expected .cabal files or additional_dependenciesr T)�exist_ok)�cabal�updater! �installz--install-method�copyz--installdir)r Zassert_version_defaultr r �starr r r r �makedirsZ setup_cmd)r r r r �pkgsZbindirr r r �install_environment! s( ���r( )� __future__r � contextlib�os.pathr �typingr r Z pre_commitr Zpre_commit.envcontextr r r Zpre_commit.errorsr Zpre_commit.prefixr r Zbasic_get_default_versionZget_default_versionZbasic_health_checkZhealth_checkZbasic_run_hookZrun_hookr �contextmanagerr r( r r r r �<module> s$