diff --git a/Makefile b/Makefile index f5d6ce37..406bc0b4 100644 --- a/Makefile +++ b/Makefile @@ -107,8 +107,9 @@ publish-version: release-commit release-tag publish-finished: clean pre-publish: clean .branch .version deps-project tests-ci build - -publish: pre-publish publish-version publish-finished +check-working-tree: + @sh ./scripts/repo_status +publish: check-working-tree pre-publish publish-version publish-finished init-docs-repo: @mkdir _book diff --git a/scripts/repo_status b/scripts/repo_status new file mode 100644 index 00000000..5cd17c83 --- /dev/null +++ b/scripts/repo_status @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ ! -z "`git status -s`" ]; then + echo "Working tree is not clean" + git status -s + read -p "Proceed? [Y/n] " OK + if [[ "$OK" -eq "n" || "$OK" -eq "N" || -z "$OK" ]]; then + echo "Stopping publish" + exit 1 + fi +fi