From f941bb920fba359370c7ddde1d81a7f60174f360 Mon Sep 17 00:00:00 2001 From: Kar Petrosyan <92274156+karpetrosyan@users.noreply.github.com> Date: Thu, 30 Nov 2023 08:11:18 -0500 Subject: [PATCH] Exit if version already was published (#122) --- scripts/publish | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/publish b/scripts/publish index 5640b415..9b516f7c 100755 --- a/scripts/publish +++ b/scripts/publish @@ -1,3 +1,10 @@ #! /bin/bash -ex -hatch publish -u __token__ -a $HISHEL_PYPI +value=$(hatch publish -u __token__ -a $HISHEL_PYPI | grep already -c) + +if [ $value -eq 0 ]; then + exit 0 +else + exit 1 +fi +