diff --git a/.ci-scripts/update-toc.sh b/.ci-scripts/update-toc.sh index d073c3d..2608016 100755 --- a/.ci-scripts/update-toc.sh +++ b/.ci-scripts/update-toc.sh @@ -8,7 +8,6 @@ function generateToc() { programNameList=() while read -r file; do - # shellcheck disable=SC2001 programName=$(cut -d@ -f1 <<<"$file") programNameList+=("$programName") done < <(find "Formula" -maxdepth 1 -type f -name '*.rb' -exec basename {} \; | sort) @@ -20,4 +19,4 @@ 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 '// {p; r '<<<"$toc" -e ':a; n; // {p; b}; ba}; p' README.md +sed -i -ne '// {p; r '<(cat <<<"$toc") -e ':a; n; // {p; b}; ba}; p' README.md