Skip to content

Commit

Permalink
refactor: update scripts from jq to grep
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Januszek committed Jan 20, 2023
1 parent d8d7e2f commit bdf3ef6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .git-hooks/pre-push-scripts/validate_latest_release.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ else
if [[ "$HTTP_STATUS_CODE" -ne 200 ]] ; then
echo -e "\033[0;31m🚫 Error, Could not fetch the latest GitHub release!"
else
LATEST_GITHUB_RELEASE=$(echo $HTTP_BODY | jq -r '.tag_name')
LATEST_GITHUB_RELEASE=$(echo $HTTP_BODY | grep -o '"tag_name": "[^"]*' | grep -o '[^"]*$')
echo "➡️ Latest GitHub Release: $LATEST_GITHUB_RELEASE"
# npm version from Package.json file
LOCAL_NPM_VERSION=$(cat "${PWD%/*/*}/package.json" | jq -r ".version")
LOCAL_NPM_VERSION=$(cat "${PWD%/*/*}/package.json" | grep -o '"version": "[^"]*' | grep -o '[^"]*$')
echo "➡️ package.json version: $LOCAL_NPM_VERSION"
#
if [[ "$LATEST_GITHUB_RELEASE" > "$LOCAL_NPM_VERSION" ]] ; then
Expand Down

0 comments on commit bdf3ef6

Please sign in to comment.