Skip to content

Commit a1c0806

Browse files
committed
chore: make release script work on macos
1 parent f23b68b commit a1c0806

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/release.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ echo "Updating version numbers in source files..."
4545

4646
for entry in "${VERSION_FILES[@]}"; do
4747
IFS=':' read -r file line_num <<< "$entry"
48-
sed -i "${line_num}s/${PREVIOUS_VERSION}/${VERSION_NO_V}/" "$file"
48+
# Use sed in a cross-platform way (macOS requires empty string after -i)
49+
if [[ "$OSTYPE" == "darwin"* ]]; then
50+
sed -i '' "${line_num}s/${PREVIOUS_VERSION}/${VERSION_NO_V}/" "$file"
51+
else
52+
sed -i "${line_num}s/${PREVIOUS_VERSION}/${VERSION_NO_V}/" "$file"
53+
fi
4954
echo " Updated $file:$line_num"
5055
done
5156

0 commit comments

Comments
 (0)