diff --git a/build b/build index 32b04aa..d7d86a3 100755 --- a/build +++ b/build @@ -18,12 +18,10 @@ done shift $((OPTIND-1)) # Extract current version from Cargo.toml & get current branch -patch_version="$(grep -Po '(?<=version = ").*(?=")' Cargo.toml | head -n1)" -major_version="$(echo "$patch_version" | - 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/')" -branch="$(git branch --show-current)" +patch_version=`grep -Po '(?<=version = ").*(?=")' Cargo.toml | head -n1` +major_version=`echo "$patch_version" | 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/'` +branch=`git rev-parse --abbrev-ref HEAD` if [[ "$branch" = "master" ]]; then tags=("$patch_version" "$minor_version" "$major_version" "latest")