From 122551627aa9f0d33d128d147287908b3509ddd4 Mon Sep 17 00:00:00 2001 From: Martin Schenck Date: Tue, 13 Apr 2021 20:28:21 +0200 Subject: [PATCH] ShellChecked release.sh --- release.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/release.sh b/release.sh index 782d356254..9adabbb287 100755 --- a/release.sh +++ b/release.sh @@ -14,7 +14,7 @@ if [ "$#" -ne 2 ]; then exit 1 fi -if [[ `git status --porcelain` ]]; then +if [[ $(git status --porcelain) ]]; then echo "Changes in the git repo." echo "Exiting." @@ -32,18 +32,18 @@ if [[ $REPLY =~ ^[Yy]$ ]] then echo "Updating package.json" TEMP_FILE=$(mktemp) - jq ".version |= \"${NEW_VERSION}\"" package.json > $TEMP_FILE || exit 1 - mv $TEMP_FILE package.json + jq ".version |= \"${NEW_VERSION}\"" package.json > "$TEMP_FILE" || exit 1 + mv "$TEMP_FILE" package.json echo "Updating manifest.json" TEMP_FILE=$(mktemp) - jq ".version |= \"${NEW_VERSION}\" | .minAppVersion |= \"${MINIMUM_OBSIDIAN_VERSION}\"" manifest.json > $TEMP_FILE || exit 1 - mv $TEMP_FILE manifest.json + jq ".version |= \"${NEW_VERSION}\" | .minAppVersion |= \"${MINIMUM_OBSIDIAN_VERSION}\"" manifest.json > "$TEMP_FILE" || exit 1 + mv "$TEMP_FILE" manifest.json echo "Updating versions.json" TEMP_FILE=$(mktemp) - jq ". += {\"${NEW_VERSION}\": \"${MINIMUM_OBSIDIAN_VERSION}\"}" versions.json > $TEMP_FILE || exit 1 - mv $TEMP_FILE versions.json + jq ". += {\"${NEW_VERSION}\": \"${MINIMUM_OBSIDIAN_VERSION}\"}" versions.json > "$TEMP_FILE" || exit 1 + mv "$TEMP_FILE" versions.json read -p "Create git commit, tag, and push? [y/N] " -n 1 -r echo