pact-foundation/pact-js

View on GitHub
scripts/ci/lib/get-version.sh

Summary

Maintainability
Test Coverage
#!/bin/bash -eu
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the script is running
. "$SCRIPT_DIR"/robust-bash.sh

require_binary grep

VERSION="$(grep '\"version\"' package.json | grep -E -o "([0-9\.]+(-[a-z\.0-9]+)?)")"
echo "$VERSION"