Sha256: 8da9b22a508a1d6adf02ad41144978df7a73d5d8ee07aef2cab91206cf469dc5

Contents?: true

Size: 923 Bytes

Versions: 19

Compression:

Stored size: 923 Bytes

Contents

#!/bin/bash

major=$(awk '/MAJOR =/ {print $3}' lib/platform_sdk/version.rb)
minor=$(awk '/MINOR =/ {print $3}' lib/platform_sdk/version.rb)

regex="\(([0-9]+)\.([0-9]+)\.([0-9]+)\)"

output=$(gem info strongmind-platform-sdk --remote)

if [[ $output =~ $regex ]]
then
    current_major="${BASH_REMATCH[1]}"
    current_minor="${BASH_REMATCH[2]}"

    if [[ $current_major != $major || $current_minor != $minor ]]
    then
      # New major or minor version, so reset patch to 0
      new_version="0"
    else
      new_version="$((BASH_REMATCH[3] + 1))"
    fi

    new_line="  PATCH = $new_version"
    if [[ "$OSTYPE" == "darwin"* ]]; then
    # macOS
    # Replace line 6 with new patch version
    sed -i "" "6s/.*/$new_line/" "lib/platform_sdk/version.rb"
    else
    # Linux
    # Replace line 6 with new patch version
    sed -i "6s/.*/$new_line/" "lib/platform_sdk/version.rb"
    fi
else
    echo "No match"
fi

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
strongmind-platform-sdk-3.22.1 bump_version.sh
strongmind-platform-sdk-3.22.0 bump_version.sh
strongmind-platform-sdk-3.21.8 bump_version.sh
strongmind-platform-sdk-3.21.7 bump_version.sh
strongmind-platform-sdk-3.21.6 bump_version.sh
strongmind-platform-sdk-3.21.5 bump_version.sh
strongmind-platform-sdk-3.21.4 bump_version.sh
strongmind-platform-sdk-3.21.3 bump_version.sh
strongmind-platform-sdk-3.21.2 bump_version.sh
strongmind-platform-sdk-3.21.1 bump_version.sh
strongmind-platform-sdk-3.21.0 bump_version.sh
strongmind-platform-sdk-3.20.3 bump_version.sh
strongmind-platform-sdk-3.20.2 bump_version.sh
strongmind-platform-sdk-3.20.1 bump_version.sh
strongmind-platform-sdk-3.20.0 bump_version.sh
strongmind-platform-sdk-3.19.40 bump_version.sh
strongmind-platform-sdk-3.19.39 bump_version.sh
strongmind-platform-sdk-3.19.38 bump_version.sh
strongmind-platform-sdk-3.19.37 bump_version.sh