"Fossies" - the Fresh Open Source Software Archive

Member "cli-1.1259.0/release-scripts/next-version.sh" (30 Nov 2023, 572 Bytes) of package /linux/misc/snyk-cli-1.1259.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/usr/bin/env bash
    2 set -euo pipefail
    3 # Checks the latest version of Snyk CLI on npm and decides the next version.
    4 # Only output the next version to stdout. All other output should go to stderr.
    5 
    6 CURRENT_VERSION="$(npm view snyk version)"
    7 RELEASE_BRANCH="master"
    8 if [ "${CIRCLE_BRANCH:-}" == "${RELEASE_BRANCH}" ]; then
    9     NEXT_VERSION="$(npx semver "${CURRENT_VERSION}" -i minor)"
   10 else
   11     NEXT_VERSION="${CURRENT_VERSION}-dev.$(git rev-parse HEAD)"
   12 fi
   13 echo "Current version: ${CURRENT_VERSION}" 1>&2
   14 echo "Next version:    ${NEXT_VERSION}" 1>&2
   15 
   16 echo "${NEXT_VERSION}"