Use array, remove VS code line
This commit is contained in:
parent
2b32ebb3cc
commit
bcdae0c5a7
15
bump_version
15
bump_version
|
@ -21,11 +21,7 @@ fi
|
||||||
shared_version_file="./SharedVersion.cs"
|
shared_version_file="./SharedVersion.cs"
|
||||||
build_file="./build.yaml"
|
build_file="./build.yaml"
|
||||||
# csproj files for nuget packages
|
# csproj files for nuget packages
|
||||||
mediabrowser_common="MediaBrowser.Common/MediaBrowser.Common.csproj"
|
jellyfin_subprojects=( MediaBrowser.Common/MediaBrowser.Common.csproj Jellyfin.Data/Jellyfin.Data.csproj MediaBrowser.Controller/MediaBrowser.Controller.csproj MediaBrowser.Model/MediaBrowser.Model.csproj Emby.Naming/Emby.Naming.csproj )
|
||||||
jellyfin_data="Jellyfin.Data/Jellyfin.Data.csproj"
|
|
||||||
mediabrowser_controller="MediaBrowser.Controller/MediaBrowser.Controller.csproj"
|
|
||||||
mediabrowser_model="MediaBrowser.Model/MediaBrowser.Model.csproj"
|
|
||||||
emby_naming="Emby.Naming/Emby.Naming.csproj"
|
|
||||||
|
|
||||||
new_version="$1"
|
new_version="$1"
|
||||||
|
|
||||||
|
@ -52,20 +48,19 @@ old_version_sed="$( sed 's/\./\\./g' <<<"${old_version}" )" # Escape the '.' cha
|
||||||
sed -i "s/${old_version_sed}/${new_version}/g" ${build_file}
|
sed -i "s/${old_version_sed}/${new_version}/g" ${build_file}
|
||||||
|
|
||||||
# update nuget package version
|
# update nuget package version
|
||||||
for f in ${mediabrowser_common} ${jellyfin_data} ${mediabrowser_controller} ${mediabrowser_model} ${emby_naming}
|
for subproject in ${jellyfin_subprojects[@]}; do
|
||||||
do
|
do
|
||||||
code ${f}
|
echo ${subproject}
|
||||||
echo ${f}
|
|
||||||
# Parse the version from the *.csproj file
|
# Parse the version from the *.csproj file
|
||||||
old_version="$(
|
old_version="$(
|
||||||
grep "VersionPrefix" ${f} \
|
grep "VersionPrefix" ${subproject} \
|
||||||
| awk '{$1=$1};1' \
|
| awk '{$1=$1};1' \
|
||||||
| sed -E 's/<VersionPrefix>([0-9\.]+[-a-z0-9]*)<\/VersionPrefix>/\1/'
|
| sed -E 's/<VersionPrefix>([0-9\.]+[-a-z0-9]*)<\/VersionPrefix>/\1/'
|
||||||
)"
|
)"
|
||||||
echo old nuget version: $old_version
|
echo old nuget version: $old_version
|
||||||
|
|
||||||
# Set the nuget version to the specified new_version
|
# Set the nuget version to the specified new_version
|
||||||
sed -i "s|${old_version}|${new_version}|g" ${f}
|
sed -i "s|${old_version}|${new_version}|g" ${subproject}
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ ${new_version} == *"-"* ]]; then
|
if [[ ${new_version} == *"-"* ]]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user