From 80650e1cf6945aed9cfaff5f1cee0c65e45a37ca Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Wed, 10 May 2023 19:50:03 +0200 Subject: [PATCH] more bash condition tombfoolery --- plugin.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugin.sh b/plugin.sh index 97eba98..064e0ae 100644 --- a/plugin.sh +++ b/plugin.sh @@ -9,12 +9,12 @@ ALLCHANGES=$(npx -y @philippdormann/changelogen@latest --from $PREVIOUSTAG --to FORMATTED_CHANGES=$(echo "# $CURRENTTAG \n $ALLCHANGES" | pandoc -f markdown -t html | sed 's/"/'"'"'/g' | xargs echo -n) -if [[ -n "$PLUGIN_GITEA_DOMAIN" ]]; then - if [[ -z "$PLUGIN_GITEA_APIKEY"]]; then +if [ "${PLUGIN_GITEA_DOMAIN:+set}" = set ]; then + if [ "${PLUGIN_GITEA_APIKEY:-null}" = null ]; then echo "No api key provided"; exit 1; fi - if [[ -z "$PLUGIN_REPO"]]; then + if [ "${PLUGIN_REPO:-null}" = null ]; then PLUGIN_REPO=$CI_REPO_NAME fi @@ -29,16 +29,16 @@ if [[ -n "$PLUGIN_GITEA_DOMAIN" ]]; then \"tag_name\": \"$CURRENTTAG\" }" fi -if [[ -n "$PLUGIN_MATRIX_SERVER" ]]; then - if [[ -z "$PLUGIN_MATRIX_USER" ]]; then +if [ "${PLUGIN_MATRIX_SERVER:+set}" = set ]; then + if [ "${PLUGIN_MATRIX_USER:-null}" = null ]; then echo "No matrix username provided"; exit 3; fi - if [[ -z "$PLUGIN_MATRIX_PASSWORD" ]]; then + if [ "${PLUGIN_REPO:-null}" = null ]; then echo "No matrix password provided"; exit 4; fi - if [[ -z "$PLUGIN_MATRIX_ROOM" ]]; then + if [ "${PLUGIN_MATRIX_ROOM:-null}" = null ]; then echo "No matrix room id provided"; exit 4; fi