From 30a898e1040ec91cea1ceeb2180bdcf7265f2407 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 1 Jul 2024 16:07:29 +0200 Subject: checkpoint --- bin/common/gt-cmd | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bin/common/gt-cmd (limited to 'bin/common/gt-cmd') diff --git a/bin/common/gt-cmd b/bin/common/gt-cmd new file mode 100755 index 0000000..66efd50 --- /dev/null +++ b/bin/common/gt-cmd @@ -0,0 +1,18 @@ +#!/bin/sh + +# path to repo +repo="$1" +# git command +command="$2" +[ "$#" -lt 2 ] && exit 1 + +repo_pretty="$(printf '%s' "$repo" | sed "s@^$HOME@~@")" + +if [ ! -d "$repo" ]; then + printf '%s missing\n' "$repo_pretty" + exit 1 +fi + +git -C "$repo" "$command" >/dev/null 2>&1 +[ $? -gt 0 ] && s="x" || s="o" +printf '%s: %s\n' "$repo_pretty" "$s" -- cgit v1.2.3