#!/usr/bin/env bash
# run specified command for each git repository found in current dir
# (c) 2019-2024 Michał Górny <mgorny@gentoo.org>
# SPDX-License-Identifier: GPL-2.0-or-later

while read -u 4 -d '' -r f; do
	echo "[${f%.git}]" >&2
	(
		cd "${f%.git}" && "${@}"
	)
done 4< <(find -name .git -print0)
