diff --git a/scripts/update-versions.sh b/scripts/update-versions.sh new file mode 100755 index 0000000000..8136578341 --- /dev/null +++ b/scripts/update-versions.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail +IFS=$'\n\t' + +cd "$(dirname $0)/.." + +if [[ $# -ne 2 ]] || [[ "$1" == "--help" ]]; then + echo "usage: $0 old-version new-version" + exit 1 +fi + +old_version="$1" +new_version="$2" + +# perl is ironically more portable than sed because of GNU/BSD differences +# the quote reduce the false positive rate +find . -type f -name '*.md' -exec perl -pi -e "s/\"$old_version\"/\"$new_version\"/g" {} \;