Skip to content

Commit e89606b

Browse files
authored
Allow modern naming conventions for version constants.
1 parent 1f1ba81 commit e89606b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

WriteBuildVersion/script.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@
1010
def main(filepath, major, minor, patch, build):
1111
# We first check to see if the file exists
1212
if (os.path.isfile(filepath)):
13-
print("Updating BuildVersion.h")
13+
print(f"Updating {filepath}")
1414

1515
for line in fileinput.input(filepath, inplace = 1):
16-
if "major" in line:
16+
if "major" in line.lower():
1717
print(line.replace("0", major).rstrip())
18-
elif "minor" in line:
18+
elif "minor" in line.lower():
1919
print(line.replace("0", minor).rstrip())
20-
elif "patch" in line:
20+
elif "patch" in line.lower():
2121
print(line.replace("0", patch).rstrip())
22-
elif "build" in line:
22+
elif "build" in line.lower():
2323
print(line.replace("0", build).rstrip())
2424
else:
2525
print(line.rstrip())
2626

2727
else:
28-
print("BuildVersion.h not found. Skipping this step")
28+
print(f"{filepath} not found. Skipping this step")
2929

3030

3131
if __name__ == '__main__':

0 commit comments

Comments
 (0)