Skip to content

Commit 206b5d1

Browse files
author
Create Index Workflow
committed
Better extra output
1 parent ecba1dc commit 206b5d1

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

build.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,19 @@ readme_update() {
3434

3535
# Append extra sheet sheets
3636
printf "\n## Installable External Cheat Sheets\n\n"
37+
printf "| Cheat Sheet | Type | Category |\n"
38+
printf "| --- | --- | --- |\n"
3739

3840
while read extra; do
39-
repo="https://github.com/$(jq -r '. | to_entries[] | select(.key == "'"$extra"'") | .value.github' extra-cheat-sheets.json)"
40-
printf " - [$extra]($repo)\n"
41-
done < <(jq -r ". | to_entries[] | .key" extra-cheat-sheets.json | LANG=C sort)
42-
41+
jq -r '. | to_entries[] | select(.key == "'"$extra"'") | .value | "| ['"$extra"']("+(.github)+") | "+(.type)+" | "+(.category)+" | "' extra-cheat-sheets.json || true
42+
done < <(jq -r ". | to_entries[] | .key" extra-cheat-sheets.json | LANG=C sort) |\
43+
sed -e "s/| Tutorial |/| 💡 Tutorial |/g" \
44+
-e "s/| Book |/| 📕 Book |/g" \
45+
-e "s/| Awesome |/| 👍 Awesome |/g" \
46+
-e "s/| Documentation |/| 📄 Documentation |/g" \
47+
-e "s/| Cheat Sheet |/| 📓 Cheat Sheet |/g" \
48+
-e "s/| Interview |/| 💬 Interview |/g" \
49+
-e "s/| Runbook |/| 🤖 Runbook |/g"
4350
) >>README.md
4451
}
4552

0 commit comments

Comments
 (0)