Skip to content

Commit b8325e9

Browse files
committed
Check return code of mkdir and suggest reason if failure
1 parent 86202a3 commit b8325e9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

build_platform.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,13 @@ def manually_install_esp32_bsp(repo_info):
115115
# Assemble git url
116116
repo_url = "git clone -b {0} https://github.com/{1}/arduino-esp32.git esp32".format(repo_info.split("/")[1], repo_info.split("/")[0])
117117
# Locally clone repo (https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html#linux)
118-
subprocess.run("mkdir -p /home/runner/Arduino/hardware/espressif", shell=True, check=True)
118+
subprocess_result = subprocess.run("mkdir -p /home/runner/Arduino/hardware/espressif", shell=True, check=True)
119+
if subprocess_result.returncode != 0:
120+
ColorPrint.print_fail("Failed to create ESP32 Arduino BSP directory!\n" +
121+
"Maybe the runner work location changed?\n" +
122+
"Tried to create /home/runner/Arduino/hardware/espressif but failed: {}".format(subprocess_result.returncode))
123+
ColorPrint.print_fail(subprocess_result.stderr)
124+
exit(-1)
119125
print("Cloning %s"%repo_url)
120126
cmd = "cd /home/runner/Arduino/hardware/espressif && " + repo_url
121127
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)

0 commit comments

Comments
 (0)