feat(tools): Restrict loading extension components to trusted sources

This commit is contained in:
Marek Fiala
2026-04-27 22:04:34 +08:00
committed by BOT
parent 997b9e82ef
commit 46cc126c50
3 changed files with 112 additions and 9 deletions
+2 -2
View File
@@ -76,7 +76,7 @@ def executable_exists(args: list) -> bool:
return False
def _idf_version_from_cmake() -> str | None:
def idf_version_from_cmake() -> str | None:
"""Acquires version of ESP-IDF from version.cmake"""
version_path = os.path.join(os.environ['IDF_PATH'], 'tools/cmake/version.cmake')
regex = re.compile(r'^\s*set\s*\(\s*IDF_VERSION_([A-Z]{5})\s+(\d+)')
@@ -124,7 +124,7 @@ def idf_version() -> str | None:
except Exception:
# if failed, then try to parse cmake.version file
sys.stderr.write('WARNING: Git version unavailable, reading from source\n')
version = _idf_version_from_cmake()
version = idf_version_from_cmake()
return version