mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 03:43:28 +01:00
Fix updateVersionPlaceholder when the placeholder starts the line
This commit is contained in:
parent
18ab353e55
commit
fe3dddcc6d
@ -129,8 +129,8 @@ def updateVersionDefine(version):
|
|||||||
def updateVersionPlaceholder(filename, version):
|
def updateVersionPlaceholder(filename, version):
|
||||||
with open(filename, 'rb') as file:
|
with open(filename, 'rb') as file:
|
||||||
lines = file.readlines()
|
lines = file.readlines()
|
||||||
placeholderRegex = re.compile(b' in Catch X.Y.Z')
|
placeholderRegex = re.compile(b'in Catch X.Y.Z')
|
||||||
replacement = ' in Catch {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii')
|
replacement = 'in Catch {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii')
|
||||||
with open(filename, 'wb') as file:
|
with open(filename, 'wb') as file:
|
||||||
for line in lines:
|
for line in lines:
|
||||||
file.write(placeholderRegex.sub(replacement, line))
|
file.write(placeholderRegex.sub(replacement, line))
|
||||||
|
Loading…
Reference in New Issue
Block a user