Skip to content

Commit

Permalink
Merge pull request #11 from ahasunos/ci/implement-version-bump
Browse files Browse the repository at this point in the history
fix: update regex to capture both single/double quotes around version
  • Loading branch information
ahasunos authored Sep 5, 2024
2 parents b3db261 + e3cae40 commit b64616e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/version_bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

def current_version
version_file = File.read(VERSION_FILE)
version_file.match(/VERSION = "(.*)"/)[1]
version_file.match(/VERSION = ['"](.*)['"]/)[1]
end

def bump_version(type)
Expand All @@ -29,7 +29,7 @@ def bump_version(type)

def update_version_file(new_version)
content = File.read(VERSION_FILE)
new_content = content.sub(/VERSION = ".*"/, "VERSION = \"#{new_version}\"")
new_content = content.gsub(/VERSION = ['"].*['"]/, "VERSION = '#{new_version}'")
File.open(VERSION_FILE, 'w') { |file| file.write(new_content) }
end

Expand Down

0 comments on commit b64616e

Please sign in to comment.