add script to automatically bump version and format
parent
c53d5d74e2
commit
0a4dc3150d
@ -0,0 +1,18 @@
|
||||
#/usr/bin/env bash
|
||||
|
||||
# This script updates the version number in the README.md files of all modules
|
||||
# to the latest tag in the repository. It is intended to be run from the root
|
||||
# of the repository or by using the `bun update-version` command.
|
||||
|
||||
LATEST_TAG=$(git describe --abbrev=0 --tags | sed 's/^v//') || exit $?
|
||||
|
||||
find . -name README.md | while read -r file; do
|
||||
awk -v tag="$LATEST_TAG" '{
|
||||
if ($1 == "version" && $2 == "=") {
|
||||
sub(/"[^"]*"/, "\"" tag "\"")
|
||||
print
|
||||
} else {
|
||||
print
|
||||
}
|
||||
}' "$file" > tmpfile && mv tmpfile "$file"
|
||||
done
|
Loading…
Reference in New Issue