mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-10 11:04:15 +02:00
improvement -> all suported types now display a 'Checking configuration file' task during the initialization process
This commit is contained in:
@@ -1,11 +1,26 @@
|
||||
from pathlib import Path
|
||||
|
||||
from bauh.commons.config import read_config as read
|
||||
from bauh.commons.config import YAMLConfigManager
|
||||
from bauh.gems.arch import CONFIG_FILE, BUILD_DIR
|
||||
|
||||
|
||||
def read_config(update_file: bool = False) -> dict:
|
||||
template = {'optimize': True,
|
||||
def get_build_dir(arch_config: dict) -> str:
|
||||
build_dir = arch_config.get('aur_build_dir')
|
||||
|
||||
if not build_dir:
|
||||
build_dir = BUILD_DIR
|
||||
|
||||
Path(build_dir).mkdir(parents=True, exist_ok=True)
|
||||
return build_dir
|
||||
|
||||
|
||||
class ArchConfigManager(YAMLConfigManager):
|
||||
|
||||
def __init__(self):
|
||||
super(ArchConfigManager, self).__init__(config_file_path=CONFIG_FILE)
|
||||
|
||||
def get_default_config(self) -> dict:
|
||||
return {'optimize': True,
|
||||
"sync_databases": True,
|
||||
"clean_cached": True,
|
||||
'aur': True,
|
||||
@@ -24,14 +39,3 @@ def read_config(update_file: bool = False) -> dict:
|
||||
'suggest_optdep_uninstall': False,
|
||||
'aur_idx_exp': 720,
|
||||
'categories_exp': 24}
|
||||
return read(CONFIG_FILE, template, update_file=update_file)
|
||||
|
||||
|
||||
def get_build_dir(arch_config: dict) -> str:
|
||||
build_dir = arch_config.get('aur_build_dir')
|
||||
|
||||
if not build_dir:
|
||||
build_dir = BUILD_DIR
|
||||
|
||||
Path(build_dir).mkdir(parents=True, exist_ok=True)
|
||||
return build_dir
|
||||
|
||||
Reference in New Issue
Block a user