Skip to content

Commit

Permalink
ShellChecked release.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
schemar committed Apr 13, 2021
1 parent ac53f87 commit 1225516
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."

Expand All @@ -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
Expand Down

0 comments on commit 1225516

Please sign in to comment.