Skip to content

Commit

Permalink
hopefully fixes esp32 build
Browse files Browse the repository at this point in the history
  • Loading branch information
kdschlosser committed May 4, 2024
1 parent f246774 commit 696e634
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions builder/esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,13 @@ def setup_idf_environ():

py_path = os.path.split(sys.executable)[0]

if 'PATH' in os.environ:
os.environ['PATH'] = py_path + os.pathsep + os.environ['PATH']
elif 'path' in os.environ:
os.environ['path'] = py_path + os.pathsep + os.environ['path']
if 'PATH' in env:
env['PATH'] = py_path + os.pathsep + env['PATH']
elif 'path' in env:
env['PATH'] = py_path + os.pathsep + env['path']
del env['path']
else:
os.environ['PATH'] = py_path + os.pathsep
env['PATH'] = py_path + os.pathsep

result, output = spawn(cmds, env=env, out_to_screen=False)

Expand All @@ -320,21 +321,11 @@ def setup_idf_environ():
for line in output
}

print(temp_env)

if 'PATH' in temp_env:
env['PATH'] = temp_env['PATH']
elif 'path' in temp_env:
env['PATH'] = temp_env['path']

if 'IDF_PATH' in temp_env:
env['IDF_PATH'] = temp_env['IDF_PATH']
elif 'idf_path' in temp_env:
env['IDF_PATH'] = temp_env['idf_path']
else:
print(output)
raise RuntimeError(f'"IDF_PATH" not found in environment.')

else:
args = sys.argv[:]

Expand Down

0 comments on commit 696e634

Please sign in to comment.