aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jails/22_forge/files/git-shell-commands/ls
diff options
context:
space:
mode:
authorJan Sydänviita <jan@sydanviita.fi>2026-08-22 21:41:32 +0300
committerJan Sydänviita <jan@sydanviita.fi>2026-08-22 21:41:32 +0300
commit901bd1ab6ba25491f138d3eba9bfa2ed3ac82488 (patch)
tree25030576eb8c55913aea1dfd9bd9652f664e0a07 /roles/jails/22_forge/files/git-shell-commands/ls
parent3d5cdb0447834fb8460dce7b9a8f4ea1c931a0c0 (diff)
Revert to single forge user, improve
Diffstat (limited to 'roles/jails/22_forge/files/git-shell-commands/ls')
-rw-r--r--roles/jails/22_forge/files/git-shell-commands/ls9
1 files changed, 5 insertions, 4 deletions
diff --git a/roles/jails/22_forge/files/git-shell-commands/ls b/roles/jails/22_forge/files/git-shell-commands/ls
index d72fa9a..7fd2dd4 100644
--- a/roles/jails/22_forge/files/git-shell-commands/ls
+++ b/roles/jails/22_forge/files/git-shell-commands/ls
@@ -1,11 +1,12 @@
#!/bin/sh
-find . -maxdepth 1 -type d -name "*.git" | sort | while read repo; do
+for repo in "$HOME"/*.git "$HOME"/.*.git; do
+ [ -d "$repo" ] || continue
name="$(basename "$repo" .git)"
desc="$(cat "$repo/description" 2>/dev/null)"
- mirror_to="$(git -C "$repo" remote get-url mirror-to 2>/dev/null)"
- mirror_from="$(git -C "$repo" remote get-url mirror-from 2>/dev/null)"
+ mirror_to="$(git -C "$repo" remote get-url mirror-to 2>/dev/null || true)"
+ mirror_from="$(git -C "$repo" remote get-url mirror-from 2>/dev/null || true)"
- printf "%-30s %s\n" "$name" "$desc"
+ printf "%-30s %s\n" "$name" "${desc:-<no description>}"
[ -n "$mirror_to" ] && printf " %-28s -> %s\n" "" "$mirror_to"
[ -n "$mirror_from" ] && printf " %-28s <- %s\n" "" "$mirror_from"
done