File tree 1 file changed +11
-9
lines changed
1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -157,15 +157,17 @@ def update_version_in_files(
157
157
with open (filepath , "r" ) as f :
158
158
version_file = f .read ()
159
159
160
- match = regex and re .search (regex , version_file , re .MULTILINE )
161
- if match :
162
- left = version_file [: match .end ()]
163
- right = version_file [match .end () :]
164
- line_break = _get_line_break_position (right )
165
- middle = right [:line_break ]
166
- current_version_found = current_version in middle
167
- right = right [line_break :]
168
- version_file = left + middle .replace (current_version , new_version ) + right
160
+ if regex :
161
+ for match in re .finditer (regex , version_file , re .MULTILINE ):
162
+ left = version_file [: match .end ()]
163
+ right = version_file [match .end () :]
164
+ line_break = _get_line_break_position (right )
165
+ middle = right [:line_break ]
166
+ current_version_found = current_version in middle
167
+ right = right [line_break :]
168
+ version_file = (
169
+ left + middle .replace (current_version , new_version ) + right
170
+ )
169
171
170
172
if not regex :
171
173
current_version_regex = _version_to_regex (current_version )
You can’t perform that action at this time.
0 commit comments