Skip to content

Commit

Permalink
added a script to update version in the buildVars.py automatically if…
Browse files Browse the repository at this point in the history
… it as not been changed but is confirmed in a commit. this can be used manually, or automatically with a post commit hook.
  • Loading branch information
davidacm committed May 2, 2023
1 parent fcbb381 commit 836c434
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ addon/doc/en/
*.py[co]
*.nvda-addon
.sconsign.dblite
*.zip
*.code-workspace
*.json
13 changes: 13 additions & 0 deletions updateVersion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import re, sys

if len(sys.argv) < 2:
print("the version was not detected")
exit(1)
version = sys.argv[1]
print(f"the version recognized is: {version}")
with open("buildVars.py", 'r+', encoding='utf-8') as f:
text = f.read()
text = re.sub('"addon_version" *:.*,', f'"addon_version" : "{version}",', text)
f.seek(0)
f.write(text)
f.truncate()

0 comments on commit 836c434

Please sign in to comment.