#!/bin/sh

GEAR_REPOS_PATH="$HOME/git"

if [ $# -ne 1 ]; then
	printf 'Usage: %s command\n' "$0"
	exit 1
fi

CMD="$1"

find "$GEAR_REPOS_PATH" -mindepth 1 -maxdepth 1 -type d |
	sed "s|^$GEAR_REPOS_PATH/||" |
		while read PACKAGE_NAME; do
			REPO_PATH="$GEAR_REPOS_PATH/$PACKAGE_NAME/$PACKAGE_NAME.git"
			#pushd "$REPO_PATH" >/dev/null
			eval "$CMD"
			#popd >/dev/null
		done

