25 lines
421 B
Text
25 lines
421 B
Text
|
#!/bin/bash
|
||
|
set -euo pipefail
|
||
|
IFS=$'\n'
|
||
|
|
||
|
cd ~git
|
||
|
source git-shell-commands/util.sh
|
||
|
arguments 0 "$#"
|
||
|
|
||
|
for dir in *.git; do
|
||
|
orig_dir="$dir"
|
||
|
case "$dir" in
|
||
|
.*) continue; ;;
|
||
|
esac
|
||
|
dir_path="$dir"
|
||
|
while [ -L "$dir" ]; do
|
||
|
dir="$(readlink "$dir")"
|
||
|
dir_path="$dir_path -> $dir"
|
||
|
done
|
||
|
if ! [ -e "$dir" ]; then
|
||
|
printf '%s (broken symlink!)\n' "$dir_path"
|
||
|
elif [ -d "$dir" ]; then
|
||
|
printf '%s\n' "$dir_path"
|
||
|
fi
|
||
|
done
|