From 8a7a9bddc6d4790923e810b6fad7f0816f15becc Mon Sep 17 00:00:00 2001 From: pika Date: Wed, 22 May 2024 19:22:55 +0200 Subject: [PATCH] testing.. --- functions/git.fish | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/functions/git.fish b/functions/git.fish index 810174d..477792e 100644 --- a/functions/git.fish +++ b/functions/git.fish @@ -9,19 +9,22 @@ function gsa # ─< Prompt the user to enter the relative path where the submodule will be cloned >──────── # ─< Advise not to use the leading / or ./ >──────────────────────────────────────────────── - echo "-- enter the relative path, where the submodule will be cloned to. (don't use fist / or ./) --" + echo -n "-- enter the relative path, where the submodule will be cloned to. (don't use fist / or ./) --" read -l -S path + echo -n "-- enter a name for the submodule --" + read -l -S name + # ─< Ask the user for confirmation if the constructed command looks correct >─────────────── - echo "git submodule add --branch $branch --name $path $repo" - echo "-- does this command look right to you? [y/n] --" + echo "git submodule add --branch $branch --name $name $repo $path" + echo -n "-- does this command look right to you? [y/n] --" read -l comm # ─< Switch statement to handle the user's confirmation input >───────────────────────────── switch $comm # ─< If the user inputs 'y' or 'Y', execute the git submodule add command >───────────────── case 'y' 'Y' - git submodule add --branch $branch --name $repo $path + git submodule add --branch $branch --name $name $repo $path # ─< If the user inputs 'n' or 'N', notify them to try again >────────────────────────────── case 'n' 'N'