|
25 | 25 | from tenacity import retry, stop_after_attempt, wait_fixed |
26 | 26 |
|
27 | 27 | 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 |
29 | 29 | from stubber.utils.config import CONFIG |
30 | 30 |
|
31 | 31 | OK = 0 |
@@ -471,12 +471,13 @@ def set_loglevel(verbose: int) -> str: |
471 | 471 | return level |
472 | 472 |
|
473 | 473 |
|
474 | | -def copy_to_repo(source: Path) -> Optional[Path]: |
| 474 | +def copy_to_repo(source: Path, fw: dict) -> Optional[Path]: |
475 | 475 | """Copy the generated stubs to the stubs repo. |
476 | 476 | If the destination folder exists, it is first emptied |
477 | 477 | when succesfull: returns the destination path - None otherwise |
478 | 478 | """ |
479 | | - destination = CONFIG.stub_path / source.name |
| 479 | + # destination = CONFIG.stub_path / source.name |
| 480 | + destination = get_board_path(fw) |
480 | 481 | try: |
481 | 482 | if destination.exists() and destination.is_dir(): |
482 | 483 | # first clean the destination folder |
@@ -514,7 +515,7 @@ def copy_to_repo(source: Path) -> Optional[Path]: |
514 | 515 | rc, my_stubs = generate_board_stubs(dest, board, variant, form) |
515 | 516 | if rc == OK: |
516 | 517 | 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): |
518 | 519 | log.success(f"Stubs copied to {destination}") |
519 | 520 | # Also merge the stubs with the docstubs |
520 | 521 | log.info(f"Merging stubs with docstubs : {board.firmware}") |
|
0 commit comments