summaryrefslogtreecommitdiff
path: root/bin/common/gt-cmd
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-07-12 14:56:14 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-07-12 14:56:14 +0200
commita4c01b0831d11775d46d1dca00b528397cbf4b03 (patch)
tree4b3ef69cb688a9db0b4d7b527f4ffa90dd5ceb2e /bin/common/gt-cmd
parentcc58700ad2483cd7ff8c9b56c0a77fc492808c01 (diff)
parent320b7ed28d5b142d208f03a3e2f851bec9e1a678 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'bin/common/gt-cmd')
-rwxr-xr-xbin/common/gt-cmd8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/common/gt-cmd b/bin/common/gt-cmd
index 66efd50..faa743a 100755
--- a/bin/common/gt-cmd
+++ b/bin/common/gt-cmd
@@ -2,9 +2,11 @@
# path to repo
repo="$1"
+shift 2>/dev/null || exit 1
# git command
-command="$2"
-[ "$#" -lt 2 ] && exit 1
+command="$1"
+shift 2>/dev/null || exit 1
+args="$*"
repo_pretty="$(printf '%s' "$repo" | sed "s@^$HOME@~@")"
@@ -13,6 +15,6 @@ if [ ! -d "$repo" ]; then
exit 1
fi
-git -C "$repo" "$command" >/dev/null 2>&1
+git -C "$repo" "$command" $args >/dev/null 2>&1
[ $? -gt 0 ] && s="x" || s="o"
printf '%s: %s\n' "$repo_pretty" "$s"