From 5f43033a7995700c728ecca73e49f05728776e80 Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Sat, 4 Dec 2021 04:19:13 +0000 Subject: [PATCH] publish checks for uncommitted/untracked changes --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0766692f4ab..b49618340bf 100644 --- a/Makefile +++ b/Makefile @@ -314,8 +314,9 @@ platform-deno: esbuild lib-typecheck | scripts/node_modules test-otp: test -n "$(OTP)" && echo publish --otp="$(OTP)" -publish-all: cmd/esbuild/version.go test-prepublish - @test master = "`git rev-parse --abbrev-ref HEAD`" || (echo "Refusing to publish from non-master branch `git rev-parse --abbrev-ref HEAD`" && false) +publish-all: platform-all + @echo "Checking for uncommitted/untracked changes..." && test -z "`git status --porcelain`" || (echo "Refusing to publish with uncommitted/untracked changes" && false) + @echo "Checking for master branch..." && test master = "`git rev-parse --abbrev-ref HEAD`" || (echo "Refusing to publish from non-master branch `git rev-parse --abbrev-ref HEAD`" && false) @echo "Checking for unpushed commits..." && git fetch @test "" = "`git cherry`" || (echo "Refusing to publish with unpushed commits" && false) rm -fr npm && git checkout npm