From 52bd033a02e832892fc2a39d2a1bdd2432c87851 Mon Sep 17 00:00:00 2001 From: Amelia Bruno Date: Mon, 5 Aug 2024 01:13:25 -0400 Subject: [PATCH] tweak(setup): Improvements to setup script (#7469) Co-authored-by: Nicholas Tindle Co-authored-by: Toran Bruce Richards --- cli.py | 2 ++ setup.sh | 34 ++++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/cli.py b/cli.py index 4c65c1485a..86e4e67cbc 100644 --- a/cli.py +++ b/cli.py @@ -69,6 +69,8 @@ d88P 888 "Y88888 "Y888 "Y88P" "Y8888P88 888 888 bold=True, ) ) + else: + click.echo(click.style("🎉 Setup completed!\n", fg="green")) @cli.group() diff --git a/setup.sh b/setup.sh index adf26bfd2e..85f4ae4786 100755 --- a/setup.sh +++ b/setup.sh @@ -10,21 +10,35 @@ else if ! command -v python3 &> /dev/null then echo "python3 could not be found" - echo "Installing python3 using pyenv..." - if ! command -v pyenv &> /dev/null - then - echo "pyenv could not be found" - echo "Installing pyenv..." - curl https://pyenv.run | bash + echo "Install python3 using pyenv ([y]/n)?" + read response + if [[ "$response" == "y" || -z "$response" ]]; then + echo "Installing python3..." + if ! command -v pyenv &> /dev/null + then + echo "pyenv could not be found" + echo "Installing pyenv..." + curl https://pyenv.run | bash + fi + pyenv install 3.11.5 + pyenv global 3.11.5 + else + echo "Aborting setup" + exit 1 fi - pyenv install 3.11.5 - pyenv global 3.11.5 fi if ! command -v poetry &> /dev/null then echo "poetry could not be found" - echo "Installing poetry..." - curl -sSL https://install.python-poetry.org | python3 - + echo "Install poetry using official installer ([y]/n)?" + read response + if [[ "$response" == "y" || -z "$response" ]]; then + echo "Installing poetry..." + curl -sSL https://install.python-poetry.org | python3 - + else + echo "Aborting setup" + exit 1 + fi fi fi