diff --git a/canary.py b/canary.py index ab6253b4..3f83bcf9 100644 --- a/canary.py +++ b/canary.py @@ -6,7 +6,7 @@ EXAMPLES_VERSION_FILE = "examples/VERSION" -def update_version(version_content): +def update_sora_version(version_content): updated_content = [] sora_version_updated = False new_version = None @@ -79,18 +79,17 @@ def main(): ) args = parser.parse_args() - # Read the VERSION file + # Read and update the VERSION file with open(VERSION_FILE, "r") as file: version_content = file.readlines() - - # Update the VERSION content - updated_content, new_version = update_version(version_content) - - # Write updated content back to VERSION file - write_version_file(VERSION_FILE, updated_content, args.dry_run) - - # Also update examples/VERSION - write_version_file(EXAMPLES_VERSION_FILE, updated_content, args.dry_run) + updated_version_content, new_version = update_sora_version(version_content) + write_version_file(VERSION_FILE, updated_version_content, args.dry_run) + + # Read and update the examples/VERSION file + with open(EXAMPLES_VERSION_FILE, "r") as file: + examples_version_content = file.readlines() + updated_examples_version_content, _ = update_sora_version(examples_version_content) + write_version_file(EXAMPLES_VERSION_FILE, updated_examples_version_content, args.dry_run) # Perform git operations git_operations(new_version, args.dry_run)