Skip to content

Commit be2c825

Browse files
committed
chore: ensure compatibility of bump-version script with BSD and GNU sed
1 parent 67b3d4c commit be2c825

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/bump-version.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ fi
6262
echo "Bumping $CURRENT_VERSION$NEW_VERSION"
6363

6464
# Update gradle.properties
65-
sed -i "s/^pluginVersion=.*/pluginVersion=${NEW_VERSION}/" "$PROPS_FILE"
65+
if sed --version >/dev/null 2>&1; then
66+
# GNU sed (Linux)
67+
sed -i "s/^pluginVersion=.*/pluginVersion=${NEW_VERSION}/" "$PROPS_FILE"
68+
else
69+
# BSD sed (macOS)
70+
sed -i '' "s/^pluginVersion=.*/pluginVersion=${NEW_VERSION}/" "$PROPS_FILE"
71+
fi
6672

6773
git add "$PROPS_FILE"
6874
git commit -m "chore: bump version to ${NEW_VERSION}"

0 commit comments

Comments
 (0)