Skip to content

Instantly share code, notes, and snippets.

@trdwll
Last active Jun 2, 2021
Embed
What would you like to do?
UEVersionChanger (ini)
import configparser
import sys
import argparse
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('Workspace', help='The path to the project that you\'re wanting to use!')
parser.add_argument('NewVersion', help='The new version to set for the project.')
args = parser.parse_args()
config_file = args.Workspace + '/Config/DefaultGame.ini'
config = configparser.ConfigParser()
config.optionxform=str
config.read(config_file)
config['/Script/EngineSettings.GeneralProjectSettings']['ProjectVersion'] = args.NewVersion
with open(config_file, 'w') as configfile:
config.write(configfile)
if __name__ == "__main__":
main(sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment