From 2495bf907489368fdce6a60cd21f16ad2a7119fe Mon Sep 17 00:00:00 2001 From: Karsten Hachmeister Date: Mon, 11 Jul 2022 13:36:28 +0200 Subject: [PATCH] add rgit command --- .local/bin/rgit | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 .local/bin/rgit diff --git a/.local/bin/rgit b/.local/bin/rgit new file mode 100755 index 0000000..92fcd8b --- /dev/null +++ b/.local/bin/rgit @@ -0,0 +1,19 @@ +#!/bin/bash + +bold=$(tput bold) +normal=$(tput sgr0) + +find -mindepth 1 -maxdepth 1 -type d | sort | while read file; do + git -C "$file" rev-parse &> /dev/null + code=$? + + if [ $code == 0 ]; then + repo=$(basename "$file") + echo "${bold}${repo}:${normal}" + + if (( "$#" > 0 )); then + git -C "$file" "$@" + fi + fi + +done