Skip to content

Commit

Permalink
fix: adapt to brew
Browse files Browse the repository at this point in the history
  • Loading branch information
aeimer committed Oct 25, 2023
1 parent 7c464e0 commit 7dafbc2
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 315 deletions.
27 changes: 0 additions & 27 deletions .ci-scripts/enforce-formula-policies.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .ci-scripts/env.sh

This file was deleted.

106 changes: 0 additions & 106 deletions .ci-scripts/generate-aliases.sh

This file was deleted.

35 changes: 0 additions & 35 deletions .ci-scripts/install-packages.sh

This file was deleted.

55 changes: 0 additions & 55 deletions .ci-scripts/parse-formulas.sh

This file was deleted.

18 changes: 11 additions & 7 deletions .ci-scripts/update-toc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ set -euo pipefail
# Enable debug - print commands
#set -x

TAP_GEN_TMP_PATH=".parsed-formula"

function generateToc() {
programNameList=()

while read -r file; do
formulaName=${file//.yaml/}
1>&2 echo " - $formulaName"
printf -- "* %s\n" "$formulaName"
done < <(find "$TAP_GEN_TMP_PATH" -maxdepth 1 -type f -name '*.yaml' -exec basename {} \; | sort)
# shellcheck disable=SC2001
programName=$(sed -E 's/(@.+)?\.rb//g' <<<"$file")
programNameList+=("$programName")
done < <(find "Formula" -maxdepth 1 -type f -name '*.rb' -exec basename {} \; | sort)

printf "* %s\n" "${programNameList[@]}" | sort -u
}

echo "Generating TOC in README.md"
toc=$(generateToc)
echo "$toc"
# https://stackoverflow.com/questions/2699666/replace-delimited-block-of-text-in-file-with-the-contents-of-another-file
sed -i -ne '/<!-- BEGIN TOC -->/ {p; r '<(generateToc) -e ':a; n; /<!-- END TOC -->/ {p; b}; ba}; p' README.md
sed -i -ne '/<!-- BEGIN TOC -->/ {p; r '<<<"$toc" -e ':a; n; /<!-- END TOC -->/ {p; b}; ba}; p' README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Update brew Aliases
run-name: Updating brew Aliases 🚀
name: Update TOC
run-name: Update TOC 🚀
on:
push:
branches:
Expand All @@ -17,21 +17,6 @@ jobs:
- name: Check out repository code
uses: actions/checkout@v4

- name: Install packages
run: .ci-scripts/install-packages.sh

- name: Parse Formulas 1
run: .ci-scripts/parse-formulas.sh

- name: Enforce Formula Policies
run: .ci-scripts/enforce-formula-policies.sh

- name: Parse Formulas 2
run: .ci-scripts/parse-formulas.sh

- name: Generate Aliases
run: .ci-scripts/generate-aliases.sh

- name: Update TOC
run: .ci-scripts/update-toc.sh

Expand Down
1 change: 0 additions & 1 deletion Aliases/protocurl.rb

This file was deleted.

1 change: 0 additions & 1 deletion Aliases/protocurl@1.rb

This file was deleted.

50 changes: 0 additions & 50 deletions Formula/protocurl@1.9.rb

This file was deleted.

0 comments on commit 7dafbc2

Please sign in to comment.