From 027c2976f5f8ad776c117e84a959e66616cf57bd Mon Sep 17 00:00:00 2001 From: Ned Palacios Date: Thu, 4 Apr 2024 09:10:00 +0800 Subject: [PATCH] fix(package.py): using wrong flag for both reading and writing (2) --- package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.py b/package.py index 57f663a..7ec836e 100644 --- a/package.py +++ b/package.py @@ -24,10 +24,12 @@ # modify style.css if THEME_VERSION is defined if 'THEME_VERSION' in os.environ: - with open(os.path.join(__dir__, 'style.css'), 'rw') as file: + with open(os.path.join(__dir__, 'style.css'), 'r+') as file: data = file.read() data = data.replace('Version: 1.0.0', f"Version: {os.environ['THEME_VERSION']}") + file.seek(0) file.write(data) + file.truncate() # Package the theme theme_name = os.path.basename(os.path.normpath(__dir__))