From 0a93b41845248a61cf2c52ef7de7b10779f3a950 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Mon, 11 Dec 2023 11:31:52 +0700 Subject: [PATCH] add version number --- gen_release.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gen_release.py b/gen_release.py index 24fa03b..2c07d5e 100644 --- a/gen_release.py +++ b/gen_release.py @@ -89,6 +89,10 @@ for environment in environments: else: config[f'env:{environment}']['build_flags'] = config[f'env:{environment}']['build_flags'] + f' -DFW_VERSION=\\"{git_branch}_{environment}_{commit_hash}\\"' +# Write the platformio.ini file +with open(os.path.join(firmware_folder, 'platformio.ini'), 'w') as configfile: + config.write(configfile) + # if argument is not supplied, build all environments listed in platformio.ini if len(sys.argv) == 1: subprocess.run([f'{platformio_path}', 'run','-c',f'{firmware_folder}/platformio.ini'], cwd=current_dir)