Sha256: f879e26eea8c9cbb676c46b262f49344bb7c6eb7d79fc41cf876e6dfaf24cf1c

Contents?: true

Size: 1.09 KB

Versions: 10

Compression:

Stored size: 1.09 KB

Contents

#!/bin/bash -e

#This script is used during the release process. It is not intended to be ran manually.

VERSION="$1"
VERSION="${VERSION:?"must provide version as first parameter"}"
SCRIPT_DIR="$(cd "$(dirname "$0")"; pwd)"

updateVersion(){
    updateGemspec
    commitStagedFiles "Update version to ${VERSION}"
}

updateGemspec(){
    echo -e "\nUpdating gemspec version"
    local gemspecPath="${SCRIPT_DIR}/logatron.gemspec"
    sed -i 's/\(\.version\s*=\s*\).*/\1'"'${VERSION}'/" "${gemspecPath}"
    stageFiles "${gemspecPath}"
}

stageAndCommit(){
    local msg="$1"
    shift
    local files=( "$@" )
    stageFiles "${files[@]}"
    commitStagedFiles "${msg}"
}

stageFiles(){
    local files=( "$@" )
    git add "${files[@]}"
}

commitStagedFiles(){
    local msg="$1"
    if thereAreStagedFiles; then
        git commit -m "${msg}"
    else
        echo "No changes to commit"
    fi
}

thereAreStagedFiles(){
    git update-index -q --ignore-submodules --refresh
    if git diff-index --cached --quiet HEAD --ignore-submodules -- ; then
        return 1;
    else
        return 0;
    fi
}

updateVersion

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
logatron-0.16.1 update_version.sh
logatron-0.16.0 update_version.sh
logatron-0.15.0 update_version.sh
logatron-0.14.0 update_version.sh
logatron-0.13.0 update_version.sh
logatron-0.12.0 update_version.sh
logatron-0.11.0 update_version.sh
logatron-0.10.0 update_version.sh
logatron-0.9.0 update_version.sh
logatron-0.8.0 update_version.sh