addet quit option

This commit is contained in:
pika 2024-06-07 11:15:52 +02:00
parent 2e51ff52a6
commit 5b647e0d7e

View file

@ -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"