From 3c0a788c2b7c36090ad138c14a644eba1263cc83 Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 29 Feb 2024 17:07:27 +0100 Subject: [PATCH] status: add ssikit --- status.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/status.sh b/status.sh index dbb7749..bd38ce1 100755 --- a/status.sh +++ b/status.sh @@ -5,6 +5,17 @@ set -u # DEBUG #set -x + +_git_info() { + d="${1}" + + cd ${d} + # src https://ma.ttias.be/pretty-git-log-in-one-line/ + commit_info="$(git log --pretty=format:'[%ci] %h %an: %s' -n 1)" + cd - >/dev/null + d_name="$(basename "${d}")" +} + main() { cd "$(dirname "${0}")" @@ -12,6 +23,9 @@ main() { | grep -E 'pilot|instance' \ | cut -d'_' -f3 )" + _git_info ./ssikit_trustchain + printf -- "%-31s | commit: %s\n" "${d_name}" "${commit_info}" + printf -- " note: outdated ssikit_trustchain version could be present on any instance. Hence, this only relevant for new or fresh builds\n\n" for i in ${instances}; do dirs="$(find . -maxdepth 1 -type d \ | grep -E 'pilot|instance' \ @@ -19,12 +33,8 @@ main() { )" echo "- ${i}" for d in ${dirs}; do - cd ${d} - # src https://ma.ttias.be/pretty-git-log-in-one-line/ - commit_info="$(git log --pretty=format:'[%ci] %h %an: %s' -n 1)" - cd - >/dev/null - d_name="$(basename "${d}")" - printf " - %-25s | commit: %s\n" "${d_name}" "${commit_info}" + _git_info "${d}" + printf -- " - %-25s | commit: %s\n" "${d_name}" "${commit_info}" done done }