Skip to content
Permalink
Browse files

Add build prefight checks

  • Loading branch information...
fluffy-critter committed Aug 23, 2019
1 parent 0c5a825 commit 74e268b8399dac98b8273a9634bd48821c59b70e
Showing with 17 additions and 1 deletion.
  1. +17 −1 Makefile
@@ -13,8 +13,24 @@ pylint:
flake8:
pipenv run flake8

.PHONY: preflight
preflight:
@echo "Checking commit status..."
@git status --porcelain | grep -q . \
&& echo "You have uncommitted changes" 1>&2 \
&& exit 1 || exit 0
@echo "Checking branch..."
@[ "$(shell git rev-parse --abbrev-ref HEAD)" != "master" ] \
&& echo "Can only build from master" 1>&2 \
&& exit 1 || exit 0
@echo "Checking upstream..."
@git fetch \
&& [ "$(shell git rev-parse master)" != "$(shell git rev-parse master@{upstream})" ] \
&& echo "Master differs from upstream" 1>&2 \
&& exit 1 || exit 0

.PHONY: build
build: pylint flake8
build: preflight pylint flake8
pipenv run python3 setup.py sdist
pipenv run python3 setup.py bdist_wheel

0 comments on commit 74e268b

Please sign in to comment.
You can’t perform that action at this time.