From 4a7bcfbf4b5af8b1813468e6cd14020040932f3a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Mon, 28 Oct 2019 11:52:32 +0100 Subject: [PATCH] Update command to get latest WordOps version with curl --- README.md | 2 +- wo/cli/templates/wo-update.mustache | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 61df27d..f7d0980 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ MIT Commits GitHub release -
WordOps install +
PyPI - Downloads codacy Badge Twitter Badge Rocket.chat diff --git a/wo/cli/templates/wo-update.mustache b/wo/cli/templates/wo-update.mustache index 9ba2e02..6ad2c01 100644 --- a/wo/cli/templates/wo-update.mustache +++ b/wo/cli/templates/wo-update.mustache @@ -7,7 +7,7 @@ safe_print() { } # Ensure sane defaults -[ -n "$URL" ] || URL="https://github.com/WordOps/WordOps/releases/latest" +[ -n "$URL" ] || URL="https://api.github.com/repos/WordOps/WordOps/releases/latest" [ -n "$WAIT" ] || WAIT=5 [ -n "$CACHE" ] || CACHE="/var/cache/motd-wo" @@ -18,7 +18,7 @@ CLOUD=$(mktemp) || exit 1 trap "rm -f $NEWS $ERR $CLOUD" HUP INT QUIT ILL TRAP BUS TERM if [ -n "$(command -v curl)" ]; then - LATEST_RELEASE=$(curl -m 5 --retry 3 -sI "$URL" | grep tag | awk -F "/" '{print $8}' 2>&1) + LATEST_RELEASE=$(curl -m 5 --retry 3 -sL "$URL" | jq -r '.tag_name' 2>&1) fi if [ -n "$(command -v wo)" ]; then CURRENT_RELEASE=$(wo -v 2>&1 | grep v | awk -F " " '{print $2}')