From 7243ae42354c28df66ab04343161675f7b76af4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Sat, 16 Mar 2024 00:10:00 +0100 Subject: [PATCH] Added user interaction for setting up zrep for the first time. - Display welcome message when running zrep for the first time. - Prompt user to set up zrep if config file is not found. - Added user confirmation before running 'zrep init'. --- zrep | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zrep b/zrep index 0c9c39d..80f349c 100755 --- a/zrep +++ b/zrep @@ -366,13 +366,15 @@ function zrep_load_config() { zrep_fpath ${config[main_zrep_install_dir]} else if [[ "${1}" == "init" ]]; then - echo "${ZREP_CONFIG} not found. Proceeding with 'zrep init'..." + echo "\nWelcome to zrep. Looks like this is the first time you are" + echo "running me." + read "response?Are you ready to set up zrep? (y/n): " + if [[ "${response}" =~ ^[Yy]$ ]]; then zrep_init else # echo "${ZREP_CONFIG} not found." # Ask the user if they want to run 'zrep init' - echo "\nWelcome to zrep. Looks like this is the first time you are" - echo "running me." + echo "\nWelcome to zrep. I was unable to find the config file." read "response?Would you like to run 'zrep init' to set up? (y/n): " if [[ "${response}" =~ ^[Yy]$ ]]; then zrep_init