From 7e9b0d79bb4ee91d8b22e1c39e64b1d41c285019 Mon Sep 17 00:00:00 2001 From: Masgalor Date: Sat, 27 Jun 2020 12:45:48 +0000 Subject: [PATCH] Fetch the newest upstream version from github api (#17) * Set the newest upstream version as default Instead of hardcoding the default version the latest upstream release should be used. * Add curl as dependency --- README.md | 1 + build.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e4b1d5f..ea98b20 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Make sure you have the required build dependencies: * docker * git * patch +* curl Then: diff --git a/build.sh b/build.sh index a073668..b74bdfd 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,7 @@ while getopts ":r:o:d:" opt; do ;; esac done -if [ -z "$REF" ]; then REF="1.15.0"; fi +if [ -z "$REF" ]; then REF=$(curl -s https://api.github.com/repos/dani-garcia/bitwarden_rs/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c 1-); fi if [ -z "$OS_VERSION_NAME" ]; then OS_VERSION_NAME='buster'; fi if [ -z "$DB_TYPE" ]; then DB_TYPE="sqlite"; fi