def git_set_email_and_name(email, name): text_helper.print_info('[GIT] Seteando email y usuario') try: git('config', '--global', 'user.email', email) git('config', '--global', 'user.name', name) except: text_helper.print_error( '[GIT] Hubo un error seteando el mail y usuario') return False text_helper.print_success( '[GIT] Mail y usario seteados satisfactoriamente')
def git_set_credentials(password, username): text_helper.print_info('[GIT] Seteando credenciales') try: git('config', '--global', 'credential.https://github.com.username', username) git('config', '--global', 'credential.https://github.com.password', password) except: text_helper.print_error( '[GIT] Hubo un error seteando las credenciales') return False text_helper.print_success('[GIT] Credenciales seteadas satisfactoriamente')
def git_clone(repo): text_helper.print_info('[GIT] Clonando: ' + utils.take_repo_name(repo)) try: git('clone', repo, './Workspace/' + utils.take_repo_name(repo), _cwd=pathlib.Path.home()) except: text_helper.print_error( '[GIT] Hubo un error al intentar clonar el repositorio') return False text_helper.print_success('[GIT] Se clono satisfactoriamente: ' + utils.take_repo_name(repo))
def build_config(): text_helper.print_info('Cargando configuraciones') text_helper.new_line() config_dict = dict() for index, filename in enumerate(os.listdir(CONFIG_PATH), start=1): print('Cargando ' + filename + '...') text_helper.separator() file = open(CONFIG_PATH + filename) data = json.load(file) if 'name' not in data: text_helper.print_error( 'El archivo ' + filename + ' no tiene una key "name", no fue agregado como opcion') continue if 'apps' not in data and 'commands' not in data: text_helper.print_error( 'El archivo ' + filename + ' no tiene apps, no fue agregado como opcion') continue config_dict[index] = {} config_dict[index]['name'] = data['name'] if 'apps' in data: config_dict[index]['apps'] = data['apps'] else: text_helper.print_warning( 'El archivo ' + filename + ' no tiene ninguna app') if 'clone' in data: config_dict[index]['clone'] = data['clone'] else: text_helper.print_warning( 'El archivo ' + filename + ' no tiene ningun repositorio a clonar') if 'zsh' in data: config_dict[index]['zsh'] = data['zsh'] text_helper.print_info('Se configurarab Zsh y Oh-my-Zsh') else: text_helper.print_info('Zsh y Oh-my-Zsh no se configuraran') text_helper.print_success( 'Archivo ' + filename + ' cargado satisfactoriamente') text_helper.new_line() return config_dict
def print_desc(name): if name in api_names: return text_helper.print_error( 'CUIDADO, ESTAS A PUNTO DE ENTRAR EN LA DICTADURA DE IGNACIO CAPUCCIO' ) if name in web_names: return text_helper.print_success( 'Buena capo, entraste al mejor team de Widergy!') if name in mobile_names: return text_helper.print_warning('SORRY, APP CRASHED, TRY AGAIN LATER')
def execute_config(config): if (utils.yes_no_query('Configuramos git?')): if _git_config(): text_helper.print_success('Listo! Git configurado') else: text_helper.print_error('Hubo un error al configurar git') if not utils.yes_no_query('Seguimos?'): exit() if not pkg_manager_helper.pacman_install(['yay']): text_helper.print_error( 'Yay no pudo ser instalado... Saliendo del configurador...') exit() text_helper.print_header('Chequeando paquetes...') filtered_packages = utils.filter_packages(config['apps']) if filtered_packages['upgradable']: text_helper.print_header('Paquetes actualizables: ' + " ".join(filtered_packages['upgradable'])) if utils.yes_no_query('Actualizar paquetes?'): pkg_manager_helper.yay_upgrade(filtered_packages['upgradable']) else: text_helper.print_info( 'No hay paquetes con actualizaciones disponibles') if filtered_packages['installed']: text_helper.print_info( 'Los siguientes paquetes estan instalados y actualizados, se omitiran: ' + " ".join(filtered_packages['installed'])) if filtered_packages['to_install']: if not pkg_manager_helper.yay_install(filtered_packages['to_install']): exit() else: text_helper.print_info('No hay paquetes para instalar')