From 5ed1d812f871750c658f4f769d6c0da3c12d1a00 Mon Sep 17 00:00:00 2001 From: Lightmann Date: Sun, 7 Jan 2024 11:56:15 -0500 Subject: [PATCH] Tiny bit of wizard cleanup --- src/dragon/wizard.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/dragon/wizard.py b/src/dragon/wizard.py index 87451fd65..c11ad8de8 100644 --- a/src/dragon/wizard.py +++ b/src/dragon/wizard.py @@ -9,12 +9,6 @@ def log(s: str, end: str = '\n') -> None: sys.stderr.flush() -def get_input(prompt: str, default: str) -> str: - log(f'{prompt} ({default})', end='\n> ') - ret = input() - return ret if ret.strip() else default - - def setup_wizard(): log(f'installing dragon v{os.environ["DRAGON_VERS"]}') log('=========================', end='\n\n') @@ -27,11 +21,11 @@ def setup_wizard(): os.chdir(dragon_root_dir) for repo in ('lib', 'include', 'frameworks', 'sdks', 'src'): - if os.path.isdir(f'{repo}') and not os.path.isdir(f'{repo}/.git'): - shutil.rmtree(f'{repo}') + if os.path.isdir(repo) and not os.path.isdir(f'{repo}/.git'): + shutil.rmtree(repo) os.system(f'git clone --depth=1 --recursive https://github.com/DragonBuild/{repo}') - elif os.path.isdir(f'{repo}') and os.path.isdir(f'{repo}/.git'): - os.chdir(f'{repo}') + elif os.path.isdir(repo) and os.path.isdir(f'{repo}/.git'): + os.chdir(repo) os.system('git pull origin $(git rev-parse --abbrev-ref HEAD)') os.chdir(dragon_root_dir) else: @@ -50,6 +44,7 @@ def setup_wizard(): pass log('Done!') + if __name__ == '__main__': setup_wizard() os.system('dragon v')