34 lines
654 B
Bash
34 lines
654 B
Bash
#!/bin/sh
|
|
list=$(curl -s 'https://tildegit.org/api/v1/orgs/tildeverse/repos?limit=100' \
|
|
| jq -r '.[] | [.name, .description, .website, .html_url] | @csv')
|
|
IFS='
|
|
'
|
|
|
|
col() {
|
|
printf "%s" "$1" | csvtool col "$2" - | sed 's/"//g'
|
|
}
|
|
|
|
for var in $list; do
|
|
name=$(col "$var" 1)
|
|
desc=$(col "$var" 2)
|
|
webs=$(col "$var" 3)
|
|
repo=$(col "$var" 4)
|
|
|
|
# Output format ---
|
|
# name - description
|
|
# link (website)
|
|
# link (repository)
|
|
printf "%s - %s\n" "$name" "$desc" | fmt -w 67
|
|
|
|
if [ -n "$webs" ]; then
|
|
printf "h(website)\tURL:%s\n" "$webs"
|
|
fi
|
|
|
|
if [ -n "$repo" ]; then
|
|
printf "h(repository)\tURL:%s\n" "$repo"
|
|
fi
|
|
|
|
printf "\n"
|
|
done
|
|
|