Created
March 24, 2016 10:51
-
-
Save fatih/9585f9bf2a6548461847 to your computer and use it in GitHub Desktop.
Makefile
This file contains hidden or 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
ifeq ($(strip $(shell git status --porcelain 2>/dev/null)),) | |
GIT_TREE_STATE=clean | |
else | |
GIT_TREE_STATE=dirty | |
endif | |
all: build | |
build: | |
@echo "==> Building the project" | |
release: check | |
@echo "==> Releasing the project" | |
check: | |
ifeq ($(GIT_TREE_STATE),dirty) | |
$(error git state is not clean) | |
endif | |
.PHONY: all build release |
Wow, just saw this gist here :D Thanks @broady. I think you're one liner is much better than what I have.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just came up with this one-liner, what do you think?