...

Text file src/github.com/go-kivik/kivik/v4/couchdb/script/test_version.sh

Documentation: github.com/go-kivik/kivik/v4/couchdb/script

     1#!/bin/bash
     2set -euC
     3
     4cur_ver=$(grep 'const Version =' constants.go | awk '{gsub(/"/, "", $4); print $4}')
     5echo "Current version: ${cur_ver}"
     6
     7cur_tag=$(git describe --tags --exact-match 2>/dev/null || true)
     8if [ "$cur_tag"x == "x" ]; then
     9    # Only run this check if we're on an actual tag
    10    exit 0
    11fi
    12
    13if [ "$cur_tag" != "$cur_ver" ]; then
    14    echo "Tag must match version"
    15    echo "${cur_tag} != ${cur_ver}"
    16    exit 1
    17fi

View as plain text