Clean up version file and add some logging

hotfix
Andrew Cassidy 2 years ago
parent 322aaa613e
commit ba189f18c4

@ -10,17 +10,14 @@
}, },
"KSP_VERSION": { "KSP_VERSION": {
"MAJOR": 1, "MAJOR": 1,
"MINOR": 11, "MINOR": 12,
"PATCH": 0
}, },
"KSP_VERSION_MIN": { "KSP_VERSION_MIN": {
"MAJOR": 1, "MAJOR": 1,
"MINOR": 8, "MINOR": 8,
"PATCH": 0
}, },
"KSP_VERSION_MAX": { "KSP_VERSION_MAX": {
"MAJOR": 1, "MAJOR": 1,
"MINOR": 12, "MINOR": 12,
"PATCH": 99
} }
} }

@ -27,6 +27,7 @@ def run():
version_path = 'GameData/ConformalDecals/Versioning/ConformalDecals.version' version_path = 'GameData/ConformalDecals/Versioning/ConformalDecals.version'
with open(version_path, 'r+') as version_file: with open(version_path, 'r+') as version_file:
print('Updating version file')
segments = version.split('.') segments = version.split('.')
# print(version_file.read()) # print(version_file.read())
decoded = json.load(version_file) decoded = json.load(version_file)
@ -41,6 +42,7 @@ def run():
project_path = 'Source/ConformalDecals/ConformalDecals.csproj' project_path = 'Source/ConformalDecals/ConformalDecals.csproj'
with open(project_path, 'r+') as project_file: with open(project_path, 'r+') as project_file:
print('Updating csproj file')
segments = version.split('.') segments = version.split('.')
decoded = minidom.parse(project_file) decoded = minidom.parse(project_file)
version_node = decoded.getElementsByTagName('AssemblyVersion')[0] version_node = decoded.getElementsByTagName('AssemblyVersion')[0]
@ -53,6 +55,8 @@ def run():
decoded.writexml(project_file) decoded.writexml(project_file)
project_file.truncate() project_file.truncate()
print('Done!')
if __name__ == '__main__': if __name__ == '__main__':
run() run()

Loading…
Cancel
Save