From 1de715664934ac1df26bd2d10d289bc6530c9512 Mon Sep 17 00:00:00 2001 From: William Petit Date: Thu, 24 Aug 2023 11:17:41 -0600 Subject: [PATCH] feat(version): permit branch name overwrite --- tasks/version.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasks/version.mk b/tasks/version.mk index c6d3631..9c6a9ab 100644 --- a/tasks/version.mk +++ b/tasks/version.mk @@ -1,11 +1,12 @@ -MKT_PROJECT_BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD | tr '[:upper:]' '[:lower:]' | sed -e 's/[-_ ]//g') +MKT_PROJECT_BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD) +MKT_PROJECT_CLEANED_BRANCH_NAME ?= $(shell echo $(MKT_PROJECT_BRANCH_NAME) | tr '[:upper:]' '[:lower:]' | sed -e 's/[-_ ]//g') -ifeq ($(MKT_PROJECT_BRANCH_NAME),master) +ifeq ($(MKT_PROJECT_CLEANED_BRANCH_NAME),master) MKT_PROJECT_VERSION_CHANNEL = stable -else ifeq ($(MKT_PROJECT_BRANCH_NAME),staging) +else ifeq ($(MKT_PROJECT_CLEANED_BRANCH_NAME),staging) MKT_PROJECT_VERSION_CHANNEL = testing else - MKT_PROJECT_VERSION_CHANNEL = $(MKT_PROJECT_BRANCH_NAME) + MKT_PROJECT_VERSION_CHANNEL = $(MKT_PROJECT_CLEANED_BRANCH_NAME) endif