Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd911f7d

Browse files
committed
feat: add argparse to cmake_updater_hook
Mostly to benefit from the built-in "--help",as the script takes no actual argument.
1 parent2c5f7ca commitd911f7d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

‎cmake/scripts/cmake_updater_hook.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,41 @@
66
Hint: it would be a good practice to run it before committing...
77
"""
88

9+
importargparse
910
importsubprocess
1011
importpathlib
12+
importsys
13+
14+
parser=argparse.ArgumentParser(
15+
usage="updater hook for CMake files. Fully automatic, takes no argument."
16+
)
17+
shargs=parser.parse_args()
1118

1219
script_dir=pathlib.Path(__file__).parent# Arduino_Core_STM32/cmake/scripts
1320
base_dir=script_dir.parent.parent# Arduino_Core_STM32
1421
templates_dir=base_dir/"cmake"/"templates"
1522

1623
print("Updating core/arduino...")
1724
subprocess.run(
18-
("python3",script_dir/"cmake_core.py",base_dir/"cores"/"arduino"),
25+
(sys.executable,script_dir/"cmake_core.py",base_dir/"cores"/"arduino"),
1926
check=True,
2027
)
2128

2229
print("Updating libraries/...")
2330
subprocess.run(
24-
("python3",script_dir/"cmake_libs.py","-L",base_dir/"libraries"),
31+
(sys.executable,script_dir/"cmake_libs.py","-L",base_dir/"libraries"),
2532
check=True,
2633
)
2734

2835
print("Updating variants/...")
2936
subprocess.run(
30-
("python3",script_dir/"cmake_variant.py",base_dir/"variants"),
37+
(sys.executable,script_dir/"cmake_variant.py",base_dir/"variants"),
3138
check=True,
3239
)
3340
print("Updating board database...")
3441
subprocess.run(
3542
(
36-
"python3",
43+
sys.executable,
3744
script_dir/"update_boarddb.py",
3845
"-b",
3946
base_dir/"boards.txt",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp