#!/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" # for example: www/build/examples local github_logo_svg=$(cat <<'EOF' EOF ) local examples_link="https://github.com/roc-lang/examples/tree/main/examples" local perl_script=www/scripts/add-link.pl # test if we can find perl script test -e $perl_script # Insert a github link to the example in HTML find "$examples_dir_path" -type f -name "README.html" -exec perl $perl_script "$examples_dir_path" "$examples_link" "$github_logo_svg" {} \; }