Skip to content

Commit de2c72f

Browse files
committed
fixes generating a single binary
1 parent ca3c258 commit de2c72f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

builder/esp32.py

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -921,19 +921,17 @@ def compile(): # NOQA
921921
if ret_code != 0:
922922
sys.exit(ret_code)
923923

924-
if 'To flash, run this command:' in output:
925-
output = output.split('To flash, run this command:')[-1].strip()
926-
output = output.split('\n')[0]
927-
928-
python_path, output = output.split('python ', 1)
929-
python_path += 'python'
930-
931-
esp_tool_path, output = output.split('esptool.py ', 1)
932-
esp_tool_path += 'esptool.py'
933-
esp_tool_path = esp_tool_path.replace(
934-
'../../../',
935-
os.getcwd() + '/lib/'
936-
)
924+
if 'To flash, run:' in output:
925+
output = output.split('To flash, run:')[-1].strip()
926+
927+
espressif_path = "~/.espressif"
928+
python_path = f'{espressif_path}/python_env/idf5.2_py3.10_env/bin'
929+
esp_tool_path = f'{python_path}/esptool.py'
930+
931+
output = output.split('python ', 1)[-1]
932+
output = output.split('\n', 1)[0]
933+
output = f'{python_path}/python {output}'
934+
output = output.replace('esptool.py', esp_tool_path)
937935

938936
out_cmd = []
939937

0 commit comments

Comments
 (0)