build(release): exit early if changes need pushing
MODIFY
script/release
script/release
@@ -4,6 +4,11 @@ fetch() {
git fetch --all
}
+local_history_is_clean() {
+ history=$(git rev-list --count --right-only @{u}...HEAD)
+ [ "$history" == "0" ]
+}
+
remote_history_is_clean() {
history=$(git rev-list --count --left-only @{u}...HEAD)
[ "$history" == "0" ]
@@ -95,6 +100,11 @@ main() {
exit 1
fi
+ if ! local_history_is_clean; then
+ echo "Error: changes exist that haven't been pushed to origin. Please pull"
+ exit 1
+ fi
+
if ! working_tree_is_clean; then
echo "Error: unclean working tree"
exit 1

build(release): exit early if changes need pushing