U
    b                     @   s   d dl mZmZmZmZ d dlmZ d dlZd dlZddl	m
Z
 ddlmZ ddlmZ ddlmZ dd	lmZ d
dlmZ dd ZdS )    )absolute_importdivisionprint_functionunicode_literals)	getLoggerN   )context)wrap_subprocess_call)rm_rf)encode_environment)subprocess_call   )validate_prefixc                 C   s   t tjttjptdptj| j| j| j	dd\}}t
|ttj | jd| j d}| js|jrtt|jtjd |jrt|jtjd |jdkrtt}|dd	| j	 d
 dtjkrt| ntt}|d|  |S )NZCONDA_PREFIXT)Zuse_system_tmp_pathF)envpathZraise_on_errorZcapture_output)filer   z`conda run  z` failed. (See above for error)ZCONDA_TEST_SAVE_TEMPSz3CONDA_TEST_SAVE_TEMPS :: retaining main_run script )r	   r   Zroot_prefixr   Ztarget_prefixosgetenvZdevZdebug_wrapper_scriptsZexecutable_callr   r   environcopycwdZno_capture_outputstdoutprintsysstderrZrcr   __name__errorjoinr
   Zwarning)argsparserZscriptZcommandZresponselog r"   1lib/python3.8/site-packages/conda/cli/main_run.pyexecute   s8    

	


r$   )Z
__future__r   r   r   r   Zloggingr   r   r   Zbase.contextr   Zutilsr	   Zgateways.disk.deleter
   Zcommon.compatr   Zgateways.subprocessr   commonr   r$   r"   r"   r"   r#   <module>   s   