From: Ivan Tashkinov Date: Tue, 2 Jul 2019 15:47:53 +0000 (+0300) Subject: [#1048] Fixed version parsing in pleroma_ctl. Closes #1036. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8c7d7cc9365e996c624d4bdb6c8d578687ff117f;p=akkoma [#1048] Fixed version parsing in pleroma_ctl. Closes #1036. --- diff --git a/rel/files/bin/pleroma_ctl b/rel/files/bin/pleroma_ctl index 9c67b209b..e731d20eb 100755 --- a/rel/files/bin/pleroma_ctl +++ b/rel/files/bin/pleroma_ctl @@ -30,12 +30,15 @@ detect_flavour() { detect_branch() { version="$(cut -d' ' -f2 <"$RELEASE_ROOT"/releases/start_erl.data)" - branch="$(echo "$version" | cut -d'-' -f 4)" + # Expected format: major.minor.patch_version(-number_of_commits_ahead_of_tag-gcommit_hash).branch + branch="$(echo "$version" | cut -d'.' -f 4)" if [ "$branch" = "develop" ]; then echo "develop" elif [ "$branch" = "" ]; then echo "master" else + # Note: branch name in version is of SemVer format and may only contain [0-9a-zA-Z-] symbols — + # if supporting releases for more branches, need to ensure they contain only these symbols. echo "Releases are built only for master and develop branches" >&2 exit 1 fi