#!/usr/bin/env sh set -eu . "$(dirname $0)/_utils/input.sh" git_dir=/git remote_host="git.ediblemonad.dev" if (tty -s); then selected=$(select_repo_name) if ! [ -z "$selected" ]; then repo_dir="${git_dir}/${selected}" echo "# ${selected}" echo "" echo "- SSH clone url: git@${remote_host}:${repo_dir}" echo "- HTTPS clone url: https://${remote_host}/${selected}" echo "" echo "- Category: $(git -C "$repo_dir" config get gitweb.category)" echo "" echo "- Description: $(cat "${repo_dir}/description" 2>/dev/null)" fi else ls -1 "$git_dir" | while IPS="" read name; do echo "$name||||$(cat "${git_dir}/${name}/description" 2>/dev/null)" done | column -t -d -s "||||" fi