Skip to content

Commit e59ca0e

Browse files
committed
fix(scripts): make rc great again
1 parent 2126a09 commit e59ca0e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/rc.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ if [ -z "$PACKAGE_JSON" ]; then
1010
fi
1111

1212
VERSION=$(jq -r .version "$PACKAGE_JSON")
13+
PACKAGE_NAME=$(jq -r .name "$PACKAGE_JSON")
14+
BASE_VERSION=$(echo "$VERSION" | grep -o "^[0-9]\+\.[0-9]\+\.[0-9]\+")
1315

14-
RC_VERSION=$(npm view @eduzz/ui-layout versions --json | jq -r '.[]' | grep "4.3.0-rc" | sort -V | tail -1 | awk -F'-rc.' '{print $1"-rc."($2+1)}')
16+
RC_VERSION=$(npm view "$PACKAGE_NAME" versions --json | jq -r '.[]' | grep "${BASE_VERSION}-rc" | sort -V | tail -1 | awk -F'-rc.' '{print $1"-rc."($2+1)}')
1517

1618
if [ -z "$RC_VERSION" ]; then
1719
RC_VERSION="${VERSION}-rc.0"

0 commit comments

Comments
 (0)