@@ -153,6 +153,11 @@ def _get_installed_standard_pip_packages():
153
153
assert os .path .isdir (FRAMEWORK_DIR )
154
154
assert os .path .isdir (TOOLCHAIN_DIR )
155
155
156
+ def create_silent_action (action_func ):
157
+ """Create a silent SCons action that suppresses output"""
158
+ silent_action = env .Action (action_func )
159
+ silent_action .strfunction = lambda target , source , env : ''
160
+ return silent_action
156
161
157
162
if "arduino" in env .subst ("$PIOFRAMEWORK" ):
158
163
ARDUINO_FRAMEWORK_DIR = platform .get_package_dir ("framework-arduinoespressif32" )
@@ -2196,8 +2201,7 @@ def idf_lib_copy(source, target, env):
2196
2201
from component_manager import ComponentManager
2197
2202
component_manager = ComponentManager (env )
2198
2203
component_manager .restore_pioarduino_build_py ()
2199
- silent_action = env .Action (idf_lib_copy )
2200
- silent_action .strfunction = lambda target , source , env : '' # hack to silence scons command output
2204
+ silent_action = create_silent_action (idf_lib_copy )
2201
2205
env .AddPostAction ("checkprogsize" , silent_action )
2202
2206
2203
2207
if "espidf" in env .subst ("$PIOFRAMEWORK" ) and (flag_custom_component_add == True or flag_custom_component_remove == True ):
@@ -2220,8 +2224,7 @@ def idf_custom_component(source, target, env):
2220
2224
from component_manager import ComponentManager
2221
2225
component_manager = ComponentManager (env )
2222
2226
component_manager .restore_pioarduino_build_py ()
2223
- silent_action = env .Action (idf_custom_component )
2224
- silent_action .strfunction = lambda target , source , env : '' # hack to silence scons command output
2227
+ silent_action = create_silent_action (idf_custom_component )
2225
2228
env .AddPostAction ("checkprogsize" , silent_action )
2226
2229
#
2227
2230
# Process OTA partition and image
0 commit comments