Skip to content

Instantly share code, notes, and snippets.

@fatih
Created March 24, 2016 11:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatih/57277859a1ed26d236db to your computer and use it in GitHub Desktop.
Save fatih/57277859a1ed26d236db to your computer and use it in GitHub Desktop.
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:
$(if $(strip $(shell git status --porcelain 2>/dev/null)),$(error git tree state is dirty),)
.PHONY: all build release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment