Skip to content

Commit cdcf27a

Browse files
update build scripts
1 parent 2548bae commit cdcf27a

4 files changed

Lines changed: 12 additions & 0 deletions

File tree

build_and_flash_debug.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import subprocess
44
import importlib.util
55
import sys
6+
import os
67

78

89
def run(cmd: list[str]) -> None:
@@ -27,6 +28,8 @@ def import_and_run_build():
2728

2829

2930
def main():
31+
repo_root = Path(__file__).parent.resolve()
32+
os.chdir(repo_root)
3033
# 1) Run build_debug.main()
3134
import_and_run_build()
3235

build_and_flash_release.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import subprocess
44
import importlib.util
55
import sys
6+
import os
67

78

89
def run(cmd: list[str]) -> None:
@@ -27,6 +28,8 @@ def import_and_run_build():
2728

2829

2930
def main():
31+
repo_root = Path(__file__).parent.resolve()
32+
os.chdir(repo_root)
3033
# 1) Run build_release.main()
3134
import_and_run_build()
3235

build_debug.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import subprocess
33
from pathlib import Path
44
import sys
5+
import os
56

67

78
def run(cmd: list[str]) -> None:
@@ -10,6 +11,8 @@ def run(cmd: list[str]) -> None:
1011

1112

1213
def main() -> None:
14+
repo_root = Path(__file__).parent.resolve()
15+
os.chdir(repo_root)
1316
project_dir = Path.cwd()
1417
build_dir = project_dir / "build" / "Debug_Script"
1518

build_release.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import subprocess
33
from pathlib import Path
44
import sys
5+
import os
56

67

78
def run(cmd: list[str]) -> None:
@@ -10,6 +11,8 @@ def run(cmd: list[str]) -> None:
1011

1112

1213
def main() -> None:
14+
repo_root = Path(__file__).parent.resolve()
15+
os.chdir(repo_root)
1316
project_dir = Path.cwd()
1417
build_dir = project_dir / "build" / "Release_Script"
1518

0 commit comments

Comments
 (0)