diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..f0dda82 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Github repository +REPO="zyedidia/micro" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Get version number from tag name +VERSION=$(echo "$TAG_NAME" | rev | cut -d'-' -f1 | rev) + +# Trim 'v' character in VERSION variable +VERSION=$(echo "$VERSION" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info index d3dd26f..d1282af 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: micro description: A modern and intuitive terminal-based text editor version: 2.0.14 -revision: 2 +revision: 3 url: https://micro-editor.github.io/ license: MIT architecture: any diff --git a/source.sh b/source.sh index 8a071e3..0991cdd 100644 --- a/source.sh +++ b/source.sh @@ -15,7 +15,7 @@ prepare() { # The build function is executed in the source directory # This function is used to compile the source code build() { - make + make VERSION="$BPM_PKG_VERSION" } # The check function is executed in the source directory