Browse Source

[#1048] Fixed version parsing in pleroma_ctl. Closes #1036.

underscore-world
Ivan Tashkinov 2 months ago
parent
commit
8c7d7cc936
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      rel/files/bin/pleroma_ctl

+ 4
- 1
rel/files/bin/pleroma_ctl View File

@@ -30,12 +30,15 @@ detect_flavour() {
30 30
 
31 31
 detect_branch() {
32 32
 	version="$(cut -d' ' -f2 <"$RELEASE_ROOT"/releases/start_erl.data)"
33
-	branch="$(echo "$version" | cut -d'-' -f 4)"
33
+	# Expected format: major.minor.patch_version(-number_of_commits_ahead_of_tag-gcommit_hash).branch
34
+	branch="$(echo "$version" | cut -d'.' -f 4)"
34 35
 	if [ "$branch" = "develop" ]; then
35 36
 		echo "develop"
36 37
 	elif [ "$branch" = "" ]; then
37 38
 		echo "master"
38 39
 	else
40
+	  # Note: branch name in version is of SemVer format and may only contain [0-9a-zA-Z-] symbols —
41
+	  #   if supporting releases for more branches, need to ensure they contain only these symbols.
39 42
 		echo "Releases are built only for master and develop branches" >&2
40 43
 		exit 1
41 44
 	fi

Loading…
Cancel
Save