mirror of
https://github.com/jellyfin/jellyfin-meta-plugins.git
synced 2024-11-22 21:59:42 +00:00
show_drafts: only run hub once per submodule
This commit is contained in:
parent
cd67484eb1
commit
6112277189
@ -18,35 +18,34 @@ colorize_changelog() {
|
||||
-e "s/@([^ ]+)$/${esc}[1;30m@${esc}[0;36m\1${esc}[0m/gi"
|
||||
}
|
||||
|
||||
echo "Fetching git release info..."
|
||||
DRAFTS=$(
|
||||
git submodule foreach \
|
||||
'hub release --include-drafts -f "$(basename $PWD)|%T|%t|%S%n"' \
|
||||
| grep draft
|
||||
)
|
||||
|
||||
IFS=$'\n'
|
||||
for draft in $DRAFTS; do
|
||||
IFS='|' parts=(${draft})
|
||||
name=${parts[0]}
|
||||
tag=${parts[1]}
|
||||
title=${parts[2]}
|
||||
|
||||
echo
|
||||
echo -e "\e[1m$name\e[0m: $title"
|
||||
|
||||
for name in $(git submodule foreach --quiet 'basename $PWD'); do
|
||||
pushd $name > /dev/null
|
||||
description=$(hub release show $tag)
|
||||
changes=$(echo $description | grep -Po '^\s*\K\*.*$' )
|
||||
draft="$(hub release --include-drafts -L2 -f 'SOF:%S%n%T%n%t%n%U%n%b%nEOF%n' --color=always | sed -n -e '/SOF:draft/,/EOF/p' | sed -e '1d' -e '$d')"
|
||||
|
||||
meta_version=$(grep -Po "version: ?[\"']?\K.*(?=[\"']$)" build.yaml | rstrip_ver)
|
||||
draft_version=$(echo $tag | grep -Po 'v\K.*' | rstrip_ver)
|
||||
if [ ! -z "$draft" ]; then
|
||||
IFS=$'\n' parts=(${draft})
|
||||
|
||||
if [ "$meta_version" != "$draft_version" ]; then
|
||||
echo -e " \e[1;31mVersion bump needed!"
|
||||
echo -e " \e[0;31mDraft is for v\e[0m\e[1m$draft_version\e[0;31m, but build.yaml specifies v\e[0m\e[1m$meta_version\e[0m"
|
||||
tag="${parts[0]}"
|
||||
title="${parts[1]}"
|
||||
url="${parts[2]}"
|
||||
IFS=$'\n' description="${parts[*]:3}"
|
||||
|
||||
echo
|
||||
echo -e "\e[1m$name\e[0m: $title\n \e[34m$url\e[0m"
|
||||
|
||||
changes=$(echo "$description" | grep -Po '^\s*\K\*.*$' )
|
||||
|
||||
meta_version=$(grep -Po "version: ?[\"']?\K.*(?=[\"']$)" build.yaml | rstrip_ver)
|
||||
draft_version=$(echo $tag | grep -Po 'v\K.*' | rstrip_ver)
|
||||
|
||||
if [ "$meta_version" != "$draft_version" ]; then
|
||||
echo -e " \e[1;31mVersion bump needed!"
|
||||
echo -e " \e[0;31mDraft is for v\e[0m\e[1m$draft_version\e[0;31m, but build.yaml specifies v\e[0m\e[1m$meta_version\e[0m"
|
||||
fi
|
||||
|
||||
echo "$changes" | colorize_changelog
|
||||
fi
|
||||
|
||||
echo $changes | colorize_changelog
|
||||
popd > /dev/null
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user