Skip to content

Commit

Permalink
Tiny bit of wizard cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
L1ghtmann authored and 0cyn committed Jan 10, 2024
1 parent 5af6ab5 commit 5ed1d81
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/dragon/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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:
Expand All @@ -50,6 +44,7 @@ def setup_wizard():
pass
log('Done!')


if __name__ == '__main__':
setup_wizard()
os.system('dragon v')

0 comments on commit 5ed1d81

Please sign in to comment.