def increment_version(folder, config, level): # - iterate through all projects # - read the VERSION file and compare to previous version (given) # - if equal, automatically increase the version (on the given level) # - overwrite the VERSION if not "version" in config: print("Could not find 'version' in config of %s"%folder) return None version = SemanticVersion(config["version"]); version.increment(level) config["version"] = version.str(); print ("Writing new version: %s"%(version.str())) write_json(module_file(folder), config)
def get_module_config(root, module): folder = os.path.join(root, module["folder"]) filename = module_file(folder) if not os.path.exists(filename): return None return read_json(filename)