Skip to content

chore: fix bump-version.sh matching spaces in sentry.h#1431

Merged
JoshuaMoelans merged 3 commits intomasterfrom
fix/bump-version-spaces
Oct 29, 2025
Merged

chore: fix bump-version.sh matching spaces in sentry.h#1431
JoshuaMoelans merged 3 commits intomasterfrom
fix/bump-version-spaces

Conversation

@JoshuaMoelans
Copy link
Member

@JoshuaMoelans JoshuaMoelans commented Oct 28, 2025

echo "Bumping version: ${NEW_VERSION}"

perl -pi -e "s/^#define SENTRY_SDK_VERSION.*/#define SENTRY_SDK_VERSION \"${NEW_VERSION}\"/" include/sentry.h
perl -pi -e "s/^# define SENTRY_SDK_VERSION.*/# define SENTRY_SDK_VERSION \"${NEW_VERSION}\"/" include/sentry.h
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also make the regex independent of the clang-format indent by capturing the spaces between # and define, then using them in the output string... something like

Suggested change
perl -pi -e "s/^# define SENTRY_SDK_VERSION.*/# define SENTRY_SDK_VERSION \"${NEW_VERSION}\"/" include/sentry.h
perl -pi -e "s/^(#\s*)define SENTRY_SDK_VERSION.*/${1}define SENTRY_SDK_VERSION \"${NEW_VERSION}\"/" include/sentry.h

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, I adapted the suggestion in 9d8180d & tested it locally 👌

@JoshuaMoelans JoshuaMoelans merged commit 0af834e into master Oct 29, 2025
40 checks passed
@JoshuaMoelans JoshuaMoelans deleted the fix/bump-version-spaces branch October 29, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants