From 29700a51288bda592d50a138d4d7de999103b078 Mon Sep 17 00:00:00 2001 From: Austin Bozowski Date: Fri, 27 May 2022 22:24:00 +0000 Subject: [PATCH] stateful shell --- examples/chef/chef.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/chef/chef.py b/examples/chef/chef.py index b3ac09334a6ce3..59cbb94df6f593 100755 --- a/examples/chef/chef.py +++ b/examples/chef/chef.py @@ -19,7 +19,6 @@ import optparse import os import shutil -import subprocess import sys import tarfile import textwrap @@ -349,13 +348,10 @@ def main(argv: Sequence[str]) -> None: # if options.ci: - # if options.build_target == "nrfconnect": - # os.environ['GNUARMEMB_TOOLCHAIN_PATH'] = os.environ['PW_ARM_CIPD_INSTALL_DIR'] for device_name in [d for d in _DEVICE_LIST if d in _CI_ALLOW_LIST]: - shell.run_cmd("export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"") - shell.run_cmd("./chef.py -cbr --use_zzz -d {device_name} -t {options.build_target}") - # command = f"./chef.py -cbr --use_zzz -d {device_name} -t {options.build_target}" - # subprocess.check_call(command, cwd=_CHEF_SCRIPT_PATH, shell=True) + if options.build_target == "nrfconnect": + shell.run_cmd("export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"") + shell.run_cmd(f"./{_REPO_BASE_PATH}/examples/chef/chef.py -cbr --use_zzz -d {device_name} -t {options.build_target}") exit(0) # @@ -378,11 +374,11 @@ def main(argv: Sequence[str]) -> None: directory = platform_meta['build_dir'] label = platform_meta['platform_label'] output_dir = os.path.join(_CHEF_SCRIPT_PATH, directory) - command = f"./chef.py -cbr --use_zzz -d {device_name} -t {platform}" flush_print("-" * 64) flush_print(f"Building {command}") flush_print("-" * 64) - subprocess.check_call(command, cwd=_CHEF_SCRIPT_PATH, shell=True) + shell.run_cmd("export GNUARMEMB_TOOLCHAIN_PATH=\"$PW_ARM_CIPD_INSTALL_DIR\"") + shell.run_cmd(f"./{_REPO_BASE_PATH}/examples/chef/chef.py -cbr --use_zzz -d {device_name} -t {platform}") archive_name = f"{label}-chef-{device_name}-wifi-rpc" archive_full_name = archive_prefix + archive_name + archive_suffix flush_print(f"Adding build output to archive {archive_full_name}")