From 2c5895f3d6a6482aeb22a3408d69f556df171eb2 Mon Sep 17 00:00:00 2001 From: voluntas Date: Sun, 13 Oct 2024 16:15:30 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E8=AA=AD?= =?UTF-8?q?=E3=81=BF=E8=BE=BC=E3=81=BF=E3=82=92=E6=95=B4=E7=90=86=E3=81=99?= =?UTF-8?q?=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canary.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) 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)