diff --git a/scripts/replace_lib.py b/scripts/replace_lib.py index 82e09e28..a792cc5c 100644 --- a/scripts/replace_lib.py +++ b/scripts/replace_lib.py @@ -13,9 +13,8 @@ def calculate_md5(filepath): def main(): print(f"Pre build BLE library replacement script") - home_path = os.environ.get('HOME') or os.environ.get('USERPROFILE') source_file = 'lib/esp32-bt-lib/esp32/libbtdm_app.a' - destination_file = os.path.join(home_path, '.platformio', 'packages', 'framework-arduinoespressif32', 'tools', 'sdk', 'esp32', 'ld', 'libbtdm_app.a') + destination_file = os.path.join(env.GetProjectConfig().get("platformio", "packages_dir"), 'framework-arduinoespressif32', 'tools', 'sdk', 'esp32', 'ld', 'libbtdm_app.a') try: shutil.copyfile(source_file, destination_file)