Created
October 13, 2016 12:46
-
-
Save zsoldosp/6612049337c789672d86755a82c2f33b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: tag | |
SHELL=bash | |
# assuming v0.1.0 is the only tag in the repo | |
tag: nr_of_existing_tags := $(shell git tag | grep "\<${TAG}\>" | wc -l) | |
tag: | |
@echo ${nr_of_existing_tags} | |
ifeq (1,$(nr_of_existing_tags)) | |
@echo tag ${TAG} already present ${nr_of_existing_tags} | |
else | |
@echo tag ${TAG} NOT yet present ${nr_of_existing_tags} | |
endif | |
ifeq (0,${nr_of_existing_tags}) | |
@echo tag ${TAG} NOT yet present ${nr_of_existing_tags} | |
else | |
@echo tag ${TAG} already present ${nr_of_existing_tags} | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.PHONY: tag | |
SHELL=bash | |
# assuming v0.1.0 is the only tag in the repo | |
nr_of_existing_tags := $(shell git tag | grep "\<${TAG}\>" | wc -l) | |
tag: | |
@echo ${nr_of_existing_tags} | |
ifeq (1,$(nr_of_existing_tags)) | |
@echo tag ${TAG} already present ${nr_of_existing_tags} | |
else | |
@echo tag ${TAG} NOT yet present ${nr_of_existing_tags} | |
endif | |
ifeq (0,${nr_of_existing_tags}) | |
@echo tag ${TAG} NOT yet present ${nr_of_existing_tags} | |
else | |
@echo tag ${TAG} already present ${nr_of_existing_tags} | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ make -f Makefile.bad TAG=0.1.0 | |
0 | |
tag 0.1.0 NOT yet present 0 | |
tag 0.1.0 already present 0 | |
$ make -f Makefile.bad TAG=0.2.0 | |
0 | |
tag 0.2.0 NOT yet present 0 | |
tag 0.2.0 already present 0 | |
$ make -f Makefile.bad TAG=0.1.0 | |
0 | |
tag 0.1.0 NOT yet present 0 | |
tag 0.1.0 NOT yet present 0 | |
$ make -f Makefile.bad TAG=0.2.0 | |
0 | |
tag 0.2.0 NOT yet present 0 | |
tag 0.2.0 NOT yet present 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment