Last active
June 2, 2021 02:43
-
-
Save trdwll/c65fa5797f687ec9b47fa21212c0e09a to your computer and use it in GitHub Desktop.
UEVersionChanger (ini)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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