Skip to content

Commit

Permalink
Merge pull request #3617 from djspiewak/build/update-versions
Browse files Browse the repository at this point in the history
Drafted version update script
  • Loading branch information
durban authored May 13, 2023
2 parents 9236a21 + 8d15d28 commit 4d79bea
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/update-versions.sh
Original file line number Diff line number Diff line change
@@ -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" {} \;

0 comments on commit 4d79bea

Please sign in to comment.