Skip to content

Commit 1970373

Browse files
authored
Ensure Git is installed for Platform espressif32 (#274)
Added a check for Git installation and error handling.
1 parent a8993fc commit 1970373

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

platform.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,12 @@
9494
if IS_WINDOWS:
9595
os.environ["PLATFORMIO_SYSTEM_TYPE"] = "windows_amd64"
9696

97+
# exit without git
98+
if not shutil.which("git"):
99+
print("Git not found in PATH, please install Git.", file=sys.stderr)
100+
print("Git is needed for Platform espressif32 to work.", file=sys.stderr)
101+
raise SystemExit(1)
102+
97103
# Set IDF_TOOLS_PATH to Pio core_dir
98104
PROJECT_CORE_DIR=ProjectConfig.get_instance().get("platformio", "core_dir")
99105
IDF_TOOLS_PATH=os.path.join(PROJECT_CORE_DIR)

0 commit comments

Comments
 (0)