diff --git a/scripts/release.sh b/scripts/release.sh index 0105fb0c..582b9875 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -7,19 +7,19 @@ then exit 1 fi -VERSION=`jq -r .version <(git show :package.json)` +VERSION=`jq -r .version package.json` function parseCargoVersion { awk '$1 == "version" {gsub("\"", "", $3); print $3}' $1 } -CARGO_TOML_VERSION=`parseCargoVersion <(git show :Cargo.toml)` +CARGO_TOML_VERSION=`parseCargoVersion Cargo.toml` if [[ $VERSION != $CARGO_TOML_VERSION ]]; then echo "Node & Rust package versions do not match." >&2 echo "Node version (package.json): ${VERSION}" >&2 echo "Rust version (Cargo.toml): ${CARGO_TOML_VERSION}" >&2 exit 2 fi -CARGO_LOCK_VERSION=`parseCargoVersion <(grep -A1 matrix-hookshot <(git show :Cargo.lock))` +CARGO_LOCK_VERSION=`parseCargoVersion <(grep -A1 matrix-hookshot Cargo.lock)` if [[ $CARGO_TOML_VERSION != $CARGO_LOCK_VERSION ]]; then echo "Rust package version does not match the lockfile." >&2 echo "Rust version (Cargo.toml): ${CARGO_TOML_VERSION}" >&2 @@ -40,7 +40,7 @@ if [ $(git tag -l "$TAG") ]; then exit 5 fi -GIT_STATUS=$(git status --porcelain) +GIT_STATUS=$(git status --porcelain | grep -vE 'package.json|Cargo.(lock|toml)') if [[ -n $GIT_STATUS ]]; then echo "Uncommitted changes:" echo $GIT_STATUS