set-version.sh 466 B

1234567891011121314151617
  1. #!/bin/bash
  2. set -euf
  3. # this script accepts a version number as an argument
  4. # and replaces {{VERSION}} in src/*.md with the provided version number.
  5. if [ "$#" -ne 1 ]; then
  6. echo "Usage: $0 <version>"
  7. exit 1
  8. fi
  9. DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  10. cd "$DIR/.." || exit 1
  11. VERSION="$1"
  12. # find all .md files in src/ and replace {{VERSION}} with the provided version number
  13. find src/ -type f -name "*.md" -exec sed -i "s/{{VERSION}}/$VERSION/g" {} \;