mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-26 06:57:43 +02:00
prepare actix-router release 0.5.0-beta.3
This commit is contained in:
41
scripts/unreleased
Executable file
41
scripts/unreleased
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
bold="\033[1m"
|
||||
reset="\033[0m"
|
||||
|
||||
unreleased_for() {
|
||||
DIR=$1
|
||||
|
||||
CARGO_MANIFEST=$DIR/Cargo.toml
|
||||
CHANGELOG_FILE=$DIR/CHANGES.md
|
||||
|
||||
# get current version
|
||||
PACKAGE_NAME="$(sed -nE 's/^name ?= ?"([^"]+)"$/\1/ p' "$CARGO_MANIFEST" | head -n 1)"
|
||||
CURRENT_VERSION="$(sed -nE 's/^version ?= ?"([^"]+)"$/\1/ p' "$CARGO_MANIFEST")"
|
||||
|
||||
CHANGE_CHUNK_FILE="$(mktemp)"
|
||||
|
||||
# get changelog chunk and save to temp file
|
||||
cat "$CHANGELOG_FILE" |
|
||||
# skip up to unreleased heading
|
||||
sed '1,/Unreleased/ d' |
|
||||
# take up to previous version heading
|
||||
sed "/$CURRENT_VERSION/ q" |
|
||||
# drop last line
|
||||
sed '$d' \
|
||||
>"$CHANGE_CHUNK_FILE"
|
||||
|
||||
# if word count of changelog chunk is 0 then exit
|
||||
if [ "$(wc -w "$CHANGE_CHUNK_FILE" | awk '{ print $1 }')" = "0" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
echo "${bold}# ${PACKAGE_NAME}${reset} since ${bold}v$CURRENT_VERSION${reset}"
|
||||
cat "$CHANGE_CHUNK_FILE"
|
||||
}
|
||||
|
||||
for f in $(fd --absolute-path CHANGES.md); do
|
||||
unreleased_for $(dirname $f)
|
||||
done
|
Reference in New Issue
Block a user