diff --git a/.github/check-package-version b/.github/check-package-version index 8729d27..60c625e 100755 --- a/.github/check-package-version +++ b/.github/check-package-version @@ -2,7 +2,13 @@ PACKAGE_VERSION=$(cat package.json | jq -r .version) GITHUB_ENDPOINT="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/git/ref/tags/v${PACKAGE_VERSION}" -GITHUB_ENDPOINT_STATUS=$(curl -LI $GITHUB_ENDPOINT -o /dev/null -w '%{http_code}\n' -sH "Authorization: token ${GITHUB_TOKEN}") +GITHUB_ENDPOINT_STATUS=$( + curl \ + -LI $GITHUB_ENDPOINT \ + -o /dev/null \ + -w '%{http_code}\n' \ + -sH "Authorization: token ${GITHUB_TOKEN}" \ +) if [ "$GITHUB_ENDPOINT_STATUS" = "404" ] then diff --git a/.github/create-github-release b/.github/create-github-release index fd62a74..a9d3b6a 100644 --- a/.github/create-github-release +++ b/.github/create-github-release @@ -10,11 +10,22 @@ PAYLOAD="{ \ \"prerelease\": false \ }" GITHUB_ENDPOINT="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases" -GITHUB_ENDPOINT_STATUS=$(curl -H "Content-Type:application/json" $GITHUB_ENDPOINT -o /dev/null -w '%{http_code}\n' -d "${PAYLOAD}" -sH "Authorization: token ${GITHUB_TOKEN}") +GITHUB_ENDPOINT_STATUS=$( + curl \ + -H "Content-Type:application/json" $GITHUB_ENDPOINT \ + -o /dev/null \ + -w '%{http_code}\n' \ + -d "${PAYLOAD}" \ + -sH "Authorization: token ${GITHUB_TOKEN}" \ +) if [ "$GITHUB_ENDPOINT_STATUS" = "201" ] then echo "This version was released" +elif [ "$GITHUB_ENDPOINT_STATUS" = "404" ] +then + echo "This version wasn't released" + exit 1 else echo "There was a problem connecting to GitHub" exit 1 diff --git a/package.json b/package.json index 3581486..f6cdffe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "on-the-case", - "version": "1.1.7", + "version": "1.1.8", "description": "A module that extends JavaScript's String object with additional case-conversion support", "homepage": "https://www.npmjs.com/package/on-the-case", "bugs": "https://github.com/DanMad/on-the-case/issues",