[#17] Small changes to build script

master
Jef Roosens 2021-04-12 18:19:22 +02:00
parent 93ec27bb02
commit 34b32a3252
Signed by: Jef Roosens
GPG Key ID: 955C0660072F691F
1 changed files with 4 additions and 6 deletions

10
build
View File

@ -18,12 +18,10 @@ done
shift $((OPTIND-1)) shift $((OPTIND-1))
# Extract current version from Cargo.toml & get current branch # Extract current version from Cargo.toml & get current branch
patch_version="$(grep -Po '(?<=version = ").*(?=")' Cargo.toml | head -n1)" patch_version=`grep -Po '(?<=version = ").*(?=")' Cargo.toml | head -n1`
major_version="$(echo "$patch_version" | major_version=`echo "$patch_version" | sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/'`
sed -E 's/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/')" minor_version=`echo "$patch_version" | sed -E 's/([0-9]+).([0-9]+).([0-9]+)/\1.\2/'`
minor_version="$(echo "$patch_version" | branch=`git rev-parse --abbrev-ref HEAD`
sed -E 's/([0-9]+).([0-9]+).([0-9]+)/\1.\2/')"
branch="$(git branch --show-current)"
if [[ "$branch" = "master" ]]; then if [[ "$branch" = "master" ]]; then
tags=("$patch_version" "$minor_version" "$major_version" "latest") tags=("$patch_version" "$minor_version" "$major_version" "latest")