From 32ca783adb73ab049225ca90769f10d470c1c481 Mon Sep 17 00:00:00 2001 From: Chris Carlon Date: Tue, 22 Oct 2024 16:27:42 +0100 Subject: [PATCH] chore(extra files): updated makefile [2024-10-22] --- makefile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/makefile b/makefile index 5bdc93a..0c44d58 100644 --- a/makefile +++ b/makefile @@ -1,6 +1,19 @@ DATE := $(shell date +%Y-%m-%d) -COMMIT_TYPES := feat fix docs style refactor perf test build ci chore revert +define COMMIT_TYPES +feat: A new feature +fix: A bug fix +docs: Documentation only changes +style: Changes that do not affect the meaning of the code +refactor: A code change that neither fixes a bug nor adds a feature +perf: A code change that improves performance +test: Adding missing tests or correcting existing tests +build: Changes that affect the build system or external dependencies +ci: Changes to CI configuration files and scripts +chore: Other changes that don't modify src or test files +revert: Reverts a previous commit +endef +export COMMIT_TYPES repo-update: git-add git-commit git-push @@ -8,9 +21,11 @@ git-add: git add . git-commit: - @echo "Available commit types: $(COMMIT_TYPES)" + @echo "Available commit types:" + @echo "$$COMMIT_TYPES" | sed 's/^/ /' + @echo @read -p "Enter commit type: " type; \ - if echo "$(COMMIT_TYPES)" | grep -wq "$$type"; then \ + if echo "$$COMMIT_TYPES" | grep -q "^$$type:"; then \ read -p "Enter commit scope (optional, press enter to skip): " scope; \ read -p "Enter commit message: " msg; \ if [ -n "$$scope" ]; then \