Skip to content

Commit fb6955c

Browse files
committed
adds IDF_PATH to environment before running export script
1 parent 9185a0f commit fb6955c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

builder/esp32.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,16 @@ def setup_idf_environ():
284284
cmds.append(['. ./export.sh'])
285285
cmds.append(['printenv'])
286286

287+
env = {k: v for k, v in os.environ.items()}
288+
env['IDF_PATH'] = os.path.abspath(idf_path)
289+
287290
result, output = spawn(cmds, out_to_screen=False)
288291

289292
if result != 0:
290293
print(output)
291294
sys.exit(result)
292295

293296
output = [line for line in output.split('\n') if '=' in line]
294-
env = {key: value for (key, value) in os.environ.items()}
295297

296298
temp_env = {
297299
line.split('=', 1)[0]: line.split('=', 1)[1]
@@ -300,8 +302,7 @@ def setup_idf_environ():
300302
for item in (
301303
'PATH',
302304
'IDF_TOOLS_EXPORT_CMD',
303-
'IDF_TOOLS_INSTALL_CMD',
304-
'IDF_PATH'
305+
'IDF_TOOLS_INSTALL_CMD'
305306
):
306307
if item not in temp_env:
307308
raise RuntimeError(f'"{item}" not found in environment.')

0 commit comments

Comments
 (0)