#!/bin/sh # path to repo repo="$1" shift 2>/dev/null || exit 1 # git command command="$1" shift 2>/dev/null || exit 1 args="$*" 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" $args >/dev/null 2>&1 [ $? -gt 0 ] && s="x" || s="o" printf '%s: %s\n' "$repo_pretty" "$s"