From 9eb53549a36a4080836762e0684488c1a7a8d11b Mon Sep 17 00:00:00 2001 From: Rasmus Anthin Date: Thu, 12 Dec 2024 08:36:03 +0100 Subject: [PATCH] Copying setup_and_build scripts from TextUR. --- setup_and_build.bat | 34 ++++++++++++++++++++++++++++++++++ setup_and_build.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 setup_and_build.bat create mode 100755 setup_and_build.sh diff --git a/setup_and_build.bat b/setup_and_build.bat new file mode 100755 index 0000000..8f76a3d --- /dev/null +++ b/setup_and_build.bat @@ -0,0 +1,34 @@ +@echo off + +set REPO_DIR=TextUR + +REM Change directory +cd .. + +REM Run the dependency fetch script +python "%REPO_DIR%\fetch-dependencies.py" "%REPO_DIR%\dependencies" + +REM Navigate to the appropriate directory +cd "%REPO_DIR%\%REPO_DIR%" + +REM Run the build script +call build.bat + +:askUser +REM Ask the user if they want to run the program +set /p response=Do you want to run the program? (yes/no): + +REM Process the response +if /i "%response%"=="yes" ( + echo Running the program... + call run.bat + goto end +) else if /i "%response%"=="no" ( + echo Alright. Have a nice day! + goto end +) else ( + echo Invalid response. Please answer yes or no. + goto askUser +) + +:end diff --git a/setup_and_build.sh b/setup_and_build.sh new file mode 100755 index 0000000..bcca1cd --- /dev/null +++ b/setup_and_build.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +REPO_DIR="TextUR" + +cd .. + +./"${REPO_DIR}"/fetch-dependencies.py "${REPO_DIR}"/dependencies + +cd "${REPO_DIR}/${REPO_DIR}" + +./build.sh + +while true; do + # Ask the user + read -p "Do you want to run the program? (yes/no): " response + + # Process the response + case "$response" in + yes|y|Y|YES|Yes) + echo "Running the program..." + ./run.sh + break + ;; + no|n|N|NO|No) + echo "Alright. Have a nice day!" + break + ;; + *) + echo "Invalid response. Please answer yes or no." + ;; + esac +done +