diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..36e129b --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="tealdeer-rs/tealdeer" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info index 2e638f1..f9b75b8 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,6 @@ name: tealdeer description: A very fast implementation of tldr in Rust -version: 1.7.1 -revision: 2 +version: 1.7.2 url: https://github.com/tealdeer-rs/tealdeer license: Apache-2.0,MIT architecture: any diff --git a/source.sh b/source.sh index 1091dad..b009714 100644 --- a/source.sh +++ b/source.sh @@ -10,12 +10,14 @@ FILENAME="${DOWNLOAD##*/}" prepare() { wget "$DOWNLOAD" tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + + cd "$BPM_SOURCE" + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } # The build function is executed in the source directory # This function is used to compile the source code build() { - cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" cargo build --release --frozen } @@ -30,9 +32,11 @@ check() { package() { install -Dm755 target/release/tldr "$BPM_OUTPUT"/usr/bin/tldr + # Install shell completion install -Dm644 completion/bash_tealdeer "$BPM_OUTPUT"/usr/share/bash-completion/completions/tldr install -Dm644 completion/zsh_tealdeer "$BPM_OUTPUT"/usr/share/zsh/site-functions/_tldr install -Dm644 completion/fish_tealdeer "$BPM_OUTPUT"/usr/share/fish/vendor_completions.d/tldr.fish - + + # Install package license install -Dm644 LICENSE* -t "$BPM_OUTPUT"/usr/share/licenses/tealdeer/* }