Skip to content

Commit 77288cd

Browse files
committed
fixes stm32 build
1 parent 051a229 commit 77288cd

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

builder/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ def spawn(cmd_, out_to_screen=True, spinner=False, env=None, cmpl=False):
246246
env = os.environ
247247

248248
if isinstance(cmd_[0], str):
249-
cmd_ = ' '.join(cmd_)
250-
else:
251-
cmd_ = ' && '.join(' '.join(c) for c in cmd_)
249+
cmd_ = [cmd_[:]]
250+
251+
cmd_ = ' && '.join(' '.join(c) for c in cmd_)
252252

253253
p = subprocess.Popen(
254254
cmd_,

builder/esp32.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,27 @@ def setup_idf_environ():
296296
# this removes any IDF environment variable that may exist if the user
297297
# has the ESP-IDF installed
298298
env = {k: v for k, v in os.environ.items() if not k.startswith('IDF')}
299-
env['IDF_PATH'] = os.path.abspath(idf_path)
300-
301299
py_path = os.path.split(sys.executable)[0]
302300

301+
if 'GITHUB_RUN_ID' in env:
302+
if sys.platform.startswith('win'):
303+
env_cmds = [
304+
['echo', f"{py_path}", '|', 'Out-File', '-Append',
305+
'-FilePath', '$env:GITHUB_PATH', '-Encoding', 'utf8'],
306+
['echo', f"{os.path.abspath(idf_path)}", '|', 'Out-File', '-Append',
307+
'-FilePath', '$env:GITHUB_PATH', '-Encoding', 'utf8']
308+
]
309+
else:
310+
env_cmds = [
311+
'echo "C:/Program Files (x86)/Etc" >> $GITHUB_PATH'
312+
['echo', f"{py_path}", '>>', '$GITHUB_PATH'],
313+
['echo', f"{os.path.abspath(idf_path)}", '>>', '$GITHUB_PATH']
314+
]
315+
316+
spawn(env_cmds, env=env, out_to_screen=False)
317+
318+
env['IDF_PATH'] = os.path.abspath(idf_path)
319+
303320
if 'PATH' in env:
304321
env['PATH'] = py_path + os.pathsep + env['PATH']
305322
elif 'path' in env:

0 commit comments

Comments
 (0)