Skip to content

Commit 4d0e826

Browse files
committed
board_stubber: Use same paths as stubber.
Signed-off-by: Jos Verlinde <[email protected]>
1 parent 1879ba3 commit 4d0e826

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/board_stubber.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from tenacity import retry, stop_after_attempt, wait_fixed
2626

2727
from stubber import utils
28-
from stubber.publish.merge_docstubs import merge_all_docstubs
28+
from stubber.publish.merge_docstubs import board_folder_name, get_board_path, merge_all_docstubs
2929
from stubber.utils.config import CONFIG
3030

3131
OK = 0
@@ -471,12 +471,13 @@ def set_loglevel(verbose: int) -> str:
471471
return level
472472

473473

474-
def copy_to_repo(source: Path) -> Optional[Path]:
474+
def copy_to_repo(source: Path, fw: dict) -> Optional[Path]:
475475
"""Copy the generated stubs to the stubs repo.
476476
If the destination folder exists, it is first emptied
477477
when succesfull: returns the destination path - None otherwise
478478
"""
479-
destination = CONFIG.stub_path / source.name
479+
# destination = CONFIG.stub_path / source.name
480+
destination = get_board_path(fw)
480481
try:
481482
if destination.exists() and destination.is_dir():
482483
# first clean the destination folder
@@ -514,7 +515,7 @@ def copy_to_repo(source: Path) -> Optional[Path]:
514515
rc, my_stubs = generate_board_stubs(dest, board, variant, form)
515516
if rc == OK:
516517
log.success(f'Stubs generated for {board.firmware["port"]}-{board.firmware["board"]}')
517-
if destination := copy_to_repo(my_stubs):
518+
if destination := copy_to_repo(my_stubs, board.firmware):
518519
log.success(f"Stubs copied to {destination}")
519520
# Also merge the stubs with the docstubs
520521
log.info(f"Merging stubs with docstubs : {board.firmware}")

0 commit comments

Comments
 (0)