grm

git repo manager for self-hosted git servers
git clone git://sink.krj.st/grm
Log | Files | Refs | README | LICENSE

commit 0609808d3fbfffc893c5e6bdffb732a6e23f5d2a
parent c150d7607083aa657c51423768776b150d4edb70
Author: krasjet <nil@krj.st>
Date:   Sat, 11 Jul 2020 22:21:43 -0700

let the remove script handle multiple arguments

Diffstat:
Mgrm | 21++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/grm b/grm @@ -65,15 +65,18 @@ grm_new() { } grm_remove() { - [ -z "$1" ] && { echo "no repo name given, exiting..."; exit 1; } - - printf "remove %s [y/N]? " "$1" - read -r resp - case "$resp" in - [yY]) rm -rf "$repos_root/${1}.git" || \ - { echo "failed to remove $1"; exit 1; };; - *) exit ;; - esac + [ $# -gt 0 ] || { echo "no repo name given, exiting..."; exit 1; } + + for repo in "$@" + do + printf "remove %s [y/N]? " "$repo" + read -r resp + case "$resp" in + [yY]) rm -rf "$repos_root/$repo.git" || \ + { echo "failed to remove $repo"; exit 1; };; + *) exit ;; + esac + done } grm_list() {