Skip to content

Commit

Permalink
[chore] ask before publishing...
Browse files Browse the repository at this point in the history
If the working tree is not clean, ask if it's ok to proceed.
  • Loading branch information
diasbruno committed Jun 16, 2017
1 parent 2af9b89 commit 21dc212
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions scripts/repo_status
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 21dc212

Please sign in to comment.