meshtastic-firmware/bin/bump_version.py

17 wiersze
447 B
Python
Czysty Zwykły widok Historia

2022-08-11 20:27:44 +00:00
#!/usr/bin/env python
"""Bump the version number"""
lines = None
2022-08-11 22:35:32 +00:00
with open('version.properties', 'r', encoding='utf-8') as f:
2022-08-11 20:27:44 +00:00
lines = f.readlines()
2022-08-11 22:35:32 +00:00
with open('version.properties', 'w', encoding='utf-8') as f:
2022-08-11 20:27:44 +00:00
for line in lines:
2022-08-11 22:35:32 +00:00
if line.lstrip().startswith("build = "):
words = line.split(" = ")
ver = f'build = {int(words[1]) + 1}'
f.write(f'{ver}\n')
2022-08-11 20:27:44 +00:00
else:
f.write(line)