From 20580a0efa0e822b294f6c62ec7fe6ef8d4dc755 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Tue, 26 Dec 2023 20:48:17 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20install=20method=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev-setup.sh | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/dev-setup.sh b/dev-setup.sh index fee5319..ebd1b1d 100755 --- a/dev-setup.sh +++ b/dev-setup.sh @@ -3,16 +3,42 @@ # check if rye is installed if ! command -v rye &> /dev/null then - echo "rye could not be found: installing now ..." - curl -sSf https://rye-up.com/get | bash - echo "Check the rye docs for more info: https://rye-up.com/" + echo "rye could not be found" + echo "Would you like to install via rye or pip? Enter 'rye' or 'pip':" + read install_method + clear + + if [ "$install_method" = "rye" ] + then + echo "Installing via rye now ..." + curl -sSf https://rye-up.com/get | bash + echo "Check the rye docs for more info: https://rye-up.com/" + + elif [ "$install_method" = "pip" ] + then + echo "Installing via pip now ..." + python3 -m venv .venv + source .venv/bin/activate + pip install -r requirements.lock + + else + echo "Invalid option. Please run the script again and enter 'rye' or 'pip'." + exit 1 + fi + + clear fi -echo "SYNC: setup .venv" -rye sync +if [ "$install_method" = "rye" ] +then + echo "SYNC: setup .venv" + rye sync + + echo "ACTIVATE: activate .venv" + rye shell -echo "ACTIVATE: activate .venv" -rye shell + clear +fi echo "SETUP: install pre-commit hooks" pre-commit install