#!/usr/bin/env bash # https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ set -euxo pipefail function add_github_link_to_examples { local examples_dir_path="$1" local github_logo_svg=$(cat <<'EOF' EOF ) # Use specific example link (e.g. https://github.com/roc-lang/examples/tree/main/examples/FizzBuzz) for every example local examples_link="https://github.com/roc-lang/examples/tree/main/examples" # Insert a github link to the example in HTML find "$examples_dir_path" -type f -name "README.html" -exec perl scripts/add-link.pl "$examples_dir_path" "$examples_link" "$github_logo_svg" {} \; }