Skip to content

Commit 21dc212

Browse files
committedJun 16, 2017
[chore] ask before publishing...
If the working tree is not clean, ask if it's ok to proceed.
1 parent 2af9b89 commit 21dc212

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed
 

Diff for: ‎Makefile

+3-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ publish-version: release-commit release-tag
107107
publish-finished: clean
108108

109109
pre-publish: clean .branch .version deps-project tests-ci build
110-
111-
publish: pre-publish publish-version publish-finished
110+
check-working-tree:
111+
@sh ./scripts/repo_status
112+
publish: check-working-tree pre-publish publish-version publish-finished
112113

113114
init-docs-repo:
114115
@mkdir _book

Diff for: ‎scripts/repo_status

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
if [ ! -z "`git status -s`" ]; then
4+
echo "Working tree is not clean"
5+
git status -s
6+
read -p "Proceed? [Y/n] " OK
7+
if [[ "$OK" -eq "n" || "$OK" -eq "N" || -z "$OK" ]]; then
8+
echo "Stopping publish"
9+
exit 1
10+
fi
11+
fi

0 commit comments

Comments
 (0)