add some entry ; add a script to get tool README

This commit is contained in:
2024-03-09 17:03:46 +01:00
parent e2c846b980
commit 4a39a6d181
4 changed files with 51 additions and 25 deletions

16
getreadme.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash -eu
cli=$1
page=${2-README.md}
# lookup cli in catalog
printf -v filter '.%s|.github' ${cli}
gh=$(yq ${filter} catalog.yaml)
# build gh README URL
printf -v url1 'https://github.com/%s/raw/main/%s' ${gh} ${page}
printf -v url2 'https://github.com/%s/raw/master/%s' ${gh} ${page}
# curl and pipe to bat
CURL="curl -fsS -L"
{ ${CURL} "${url1}" || ${CURL} "${url2}" ; } | glow -p -