Skip to content

Commit

Permalink
scripts: Update README file path in ble_library.py for lib/stm32wba
Browse files Browse the repository at this point in the history
Update the README file path in ble_library.py for lib/stm32wba

Signed-off-by: Nidhal BEN OTHMEN <nidhal.benothmen@st.com>
  • Loading branch information
benothmn-st committed Dec 15, 2024
1 parent c2c3e3b commit 618f6c7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions scripts/ble_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,20 @@ def copy_hci_files(src_repo_path, dest_lib_path, stm32_serie):
sys.exit()


def update_ble_lib_readme(lib_path, make_version, make_commit):
def update_ble_lib_readme(lib_path, make_version, make_commit, stm32_serie):
"""Update README file
Args:
dest_lib_path: library path
make_version: latest STM32Cube version.
make_commit: Commit corresponding to latest STM32Cube version.
stm32_serie: stm32 serie
"""

readme_path = Path(lib_path / "hci" / "README")
if stm32_serie == "stm32wba":
readme_path = Path(lib_path / "README")
else:
readme_path = Path(lib_path / "hci" / "README")

with readme_path.open(mode="r") as readme_prev:
lines = (x for x in readme_prev.read().splitlines())
Expand Down Expand Up @@ -337,9 +341,12 @@ def update(
)
copy_hci_files(src_repo_path, dest_lib_path, stm32_serie)
common_utils.apply_patch(dest_lib_path / "ble_zephyr.patch", dest_lib_path)
if Path(dest_lib_path / "hci" / "README").exists():
update_ble_lib_readme(
dest_lib_path, update_version, commit)
if stm32_serie == "stm32wba":
if Path(dest_lib_path / "README").exists():
update_ble_lib_readme(dest_lib_path, update_version, commit, stm32_serie)
else:
if Path(dest_lib_path / "hci" / "README").exists():
update_ble_lib_readme(dest_lib_path, update_version, commit, stm32_serie)


if __name__ == "__main__":
Expand Down

0 comments on commit 618f6c7

Please sign in to comment.