From b2a035f2c90f0c272d0e7b16e865f09f17a881f2 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Mon, 20 Jan 2020 12:41:29 -0800 Subject: [PATCH] Pedantic cleanup --- .gitignore | 1 + Makefile | 2 +- VERSION | 2 +- release.sh | 11 +++++++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9194702..7b0e7e0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ gen deps index.html release.json +output.json diff --git a/Makefile b/Makefile index 85b4085..e654af1 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ mod.ts: take-five.ts all: clean test release clean: - rm -f mod.ts release.json + rm -f mod.ts release.json output.json test: $(foreach var,$(TEST_FILES),deno --allow-net $(var);) diff --git a/VERSION b/VERSION index 21e8796..ee90284 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.3 +1.0.4 diff --git a/release.sh b/release.sh index 6f3131a..b6935e3 100755 --- a/release.sh +++ b/release.sh @@ -8,7 +8,7 @@ make_path () { if echo $STATUS | grep 404 > /dev/null; then echo "Making directory ${1}" - curl -X MKCOL -u ${USER}:${TOKEN} ${SERVER}/${UPLOAD_PATH}/$1 + curl -sX MKCOL -u ${USER}:${TOKEN} ${SERVER}/${UPLOAD_PATH}/$1 else echo "Directory "${1}" already exists" fi @@ -26,7 +26,14 @@ render_markdown () { create_release () { echo "Marking release ${VERSION} on GitHub" echo "{\"tag_name\":\"v${VERSION}\",\"target_commitish\":\"master\",\"name\":\"v${VERSION}\",\"body\":\"Take-Five version ${VERSION}\"}" > release.json - curl -u ${GH_USER}:${GH_TOKEN} -sX POST https://api.github.com/repos/toddself/take-five/releases -d @release.json + STATUS=$(curl -u ${GH_USER}:${GH_TOKEN} -sX POST https://api.github.com/repos/toddself/${PROJECT}/releases -d @release.json -w '%{http_code}' -o output.json) + if echo $STATUS | grep 201 > /dev/null; + then + echo "Release generated" + else + echo "Could not make release" + cat output.json + fi } make_path $PROJECT