TAG="$(shell git describe --dirty)"

all: version git deploy

version:
	@$(shell echo jq -r "'.version |= \"$(TAG)\"'" package.json) > tmp.json
	@mv tmp.json package.json
	@echo "Version $(TAG) created"

git:
	@git add --all || true
	@git commit -m "$(shell curl -s whatthecommit.com/index.txt)" || true
	@git push origin master
	@git push origin --tags

deploy:
	@npm publish

test:
	@npm uninstall -g say-cheese
	@npm install -g say-cheese
	@please date
	@please
	@cheese
	@cheese 12 34
	@cheese -d 12 34
	@cheese 12 -d 34

.PHONY: all test
