From 5b647e0d7ecf10deb8aeb7ca80193760c7d45ef6 Mon Sep 17 00:00:00 2001 From: pika Date: Fri, 7 Jun 2024 11:15:52 +0200 Subject: [PATCH] addet quit option --- init/setup.fish | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init/setup.fish b/init/setup.fish index 1375357..10ea342 100644 --- a/init/setup.fish +++ b/init/setup.fish @@ -116,19 +116,35 @@ function gsa # ─< Prompt the user to enter the repository URL to add as a submodule >──────────────────── echo "-- enter the repository to add as a submodule --" + echo "-- (type 'quit' to quit) --" read repo + if test "$repo" -eq "quit" + exit 1 + end # ─< 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. (!! do it like this: ./path/to/clone/to) --" + echo "-- (type 'quit' to quit) --" read -S path + if test "$path" -eq "quit" + exit 1 + end # ─< Prompt the user to enter the branch to checkout (e.g., main, master) >───────────────── echo "-- enter the branch to checkout (main/master..) --" + echo "-- (type 'quit' to quit) --" read branch + if test "$branch" -eq "quit" + exit 1 + end echo "-- enter a name for the submodule --" + echo "-- (type 'quit' to quit) --" read -l name + if test "$name" -eq "quit" + exit 1 + end # ─< Ask the user for confirmation if the constructed command looks correct >─────────────── echo "git submodule add --branch $branch --name $name $repo $path"