Skip to content

Commit 9d35877

Browse files
Fix regex to only update VERSION, not PROTOCOL_VERSION
Use word boundary (\b) in regex to ensure we only match VERSION constant, not PROTOCOL_VERSION. This prevents accidentally updating the protocol version when bumping the package version.
1 parent 09e11c1 commit 9d35877

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rakelib/release.rake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ task :release, %i[version dry_run registry skip_push] do |_t, args|
122122
pro_version_content = File.read(pro_version_file)
123123
# We use gsub instead of `gem bump` here because the git tree is already dirty
124124
# from bumping the core gem version above, and `gem bump` fails with uncommitted changes
125-
# Replace only the VERSION line, keeping PROTOCOL_VERSION and all formatting intact
126-
pro_version_content.gsub!(/VERSION = ".+"/, "VERSION = \"#{actual_gem_version}\"")
125+
# Use word boundary \b to match only VERSION, not PROTOCOL_VERSION
126+
pro_version_content.gsub!(/\bVERSION = ".+"/, "VERSION = \"#{actual_gem_version}\"")
127127
File.write(pro_version_file, pro_version_content)
128128
puts " Updated #{pro_version_file}"
129129
puts " Note: react_on_rails_pro.gemspec will automatically use ReactOnRails::VERSION"

0 commit comments

Comments
 (0)