o
    Jh                     @   sT   d dl Z d dlZd dlZd dlmZ d dlmZ edZdd Z	de
fdd	ZdS )
    N)CONFIG_FILENAME)save_configzyoyo.migrationsc                 C   sB   |j d| gdd}|jtd |jdddd |jd	d
dd d S )NinitzInitialize a new project)parentshelp)funcsources   zDirectory for migration scripts)nargsr   z-dz
--databasezIDatabase, eg 'sqlite:///path/to/sqlite.db' or 'postgresql://user@host/db')r   )
add_parserset_defaultsr   add_argument)global_parser
subparsersparser r   S/var/www/html/pro-man-master/venv/lib/python3.10/site-packages/yoyo/scripts/init.pyinstall_argparsers   s   
r   returnc                 C   s   | j r
t| j }ntj t }t| jd  }| r(tdt	j
d dS t|| td|  | s?|jddd td|  dS )	Nr   z*Existing configuration file found, exiting)filer	   zSaved configuration to T)exist_okr   zCreated migrations directory )configpathlibPathcwdr   r   resolveexistsprintsysstderrr   mkdir)argsr   
configpathmigrations_pathr   r   r   r   '   s   
r   )r   loggingr   yoyo.configr   yoyo.scripts.mainr   	getLoggerloggerr   intr   r   r   r   r   <module>   s   
