Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Release message commit message type has changed to word [minor]
Browse files Browse the repository at this point in the history
- Multiline test 1
- Multilene test 2
  • Loading branch information
bgokden committed Nov 29, 2019
1 parent 1eda823 commit 70e8263
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions semver_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ get_increment_semantic_type_from_git() {
}

get_release_message_from_git() {
local latest_commit_message=$(get_commit_message_from_git)
echo $(get_release_message_from_string "$latest_commit_message")
echo $(get_commit_message_from_git)
}

get_commit_message_from_git() {
Expand All @@ -80,28 +79,15 @@ get_commit_message_from_git() {

get_increment_semantic_type_from_string() {
local message="$1"
if [[ $message =~ ^(major|MAJOR): ]]; then
if [[ $message == *"[major]"* ]]; then
echo "major"
elif [[ $message =~ ^(minor|MINOR): ]]; then
elif [[ $message == *"[minor]"* ]]; then
echo "minor"
else
echo "patch"
fi
}

get_release_message_from_string() {
local message="$1"
if [[ $message =~ ^(major|MAJOR): ]]; then
echo ${message#*:}
elif [[ $message =~ ^(minor|MINOR): ]]; then
echo ${message#*:}
elif [[ $message =~ ^(patch|PATCH): ]]; then
echo ${message#*:}
else
echo $message
fi
}

mkPath() { mkdir -p "$(dirname "$1")" || return; touch $1; }

create_go_version_file() {
Expand Down

0 comments on commit 70e8263

Please sign in to comment.