Skip to content

Merge branch 'pest-mvp' of https://github.com/DominicBurkart/marigold… #120

Merge branch 'pest-mvp' of https://github.com/DominicBurkart/marigold…

Merge branch 'pest-mvp' of https://github.com/DominicBurkart/marigold… #120

Workflow file for this run

name: badges
on: [push]
env:
CARGO_TERM_COLOR: always
jobs:
badges:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Make lines of code and number of contributors badges"
run: |
format_number () {
if (( $# == 0 )) ; then
if ! command -v numfmt &> /dev/null
then
gnumfmt --to=si < /dev/stdin
else
numfmt --to=si < /dev/stdin
fi
else
if ! command -v numfmt &> /dev/null
then
gnumfmt --to=si "$1"
else
numfmt --to=si "$1"
fi
fi
}
rm -rf development_metadata/badges
mkdir development_metadata/badges
lines="$(git ls-files | grep -e '\.rs' -e '\.lalrpop' | xargs wc -l | tail -n 1 | awk '{$1=$1};1' | cut -d " " -f1 | format_number)"
curl "https://img.shields.io/badge/lines%20of%20code-$lines-informational" >> development_metadata/badges/lines_of_code.svg
curl "https://img.shields.io/badge/lines%20of%20code-$lines-informational?style=for-the-badge" >> development_metadata/badges/lines_of_code_ftb.svg
contributors="$(git shortlog -sne --all | rev | awk '{$1=$1};1' | cut -d " " -f1 | uniq | wc -l | awk '{$1=$1};1' | format_number)"
curl "https://img.shields.io/badge/contributors-$contributors-informational" >> development_metadata/badges/contributors.svg
curl "https://img.shields.io/badge/contributors-$contributors-informational?style=for-the-badge" >> development_metadata/badges/contributors_ftb.svg
git config user.name dominicburkart
git config user.email code@dominic.computer
git add development_metadata/badges/*
git commit -m "update badges" || true
git push || true