diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..0424112 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="npm/cli" + +# 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 84d632f..e37dde9 100644 --- a/pkg.info +++ b/pkg.info @@ -1,6 +1,6 @@ name: npm description: Package Manager for JavaScript -version: 11.2.0 +version: 11.6.0 url: https://www.npmjs.com/ license: Artistic-2.0 architecture: any diff --git a/source.sh b/source.sh index fd678e2..8f8ffae 100644 --- a/source.sh +++ b/source.sh @@ -11,7 +11,7 @@ REPO="https://github.com/npm/cli.git" # The prepare function is executed in the root of the temp directory # This function is used for downloading files and putting them into the correct location prepare() { - git clone --single-branch --branch "v${BPM_PKG_VERSION}" "$REPO" "$BPM_SOURCE" + git clone --depth 1 --branch "v${BPM_PKG_VERSION}" "$REPO" "$BPM_SOURCE" } # The build function is executed in the source directory