Skip to content

Commit b46b85c

Browse files
authored
Fix release script to fail if not run from trunk (purescript#791)
1 parent 0f38c91 commit b46b85c

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

release.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@ set -euo pipefail
66
# It will create a tag and push it, which will trigger CI to create a release,
77
# build release binaries, push them to the release, and publish a new version on NPM
88

9+
# Fail if we are not on trunk
10+
BRANCH=$(git branch --show-current)
11+
if [ "${BRANCH}" != "master" ]; then
12+
echo "Please checkout master branch"
13+
exit 1;
14+
fi
15+
git pull
16+
917
NEW_TAG=$(./scripts/get-version)
1018

1119
# Fail if the new tag already exists
20+
# Note: exit status of the command is the conditional
1221
if git rev-parse "${NEW_TAG}" >/dev/null 2>&1; then
13-
echo "Tag '${NEW_TAG}' already exists, please bump the version in package.yaml";
22+
echo "Tag '${NEW_TAG}' already exists, please bump the version in spago.cabal";
1423
exit 1;
1524
fi
1625

@@ -20,4 +29,4 @@ git tag "${NEW_TAG}"
2029

2130
git push origin "${NEW_TAG}"
2231

23-
echo "Done."
32+
echo "Done."

0 commit comments

Comments
 (0)