@@ -47,10 +47,14 @@ def check_call(cmd: List[str], additional_env: Dict[str, str] = {}, verbose: boo
47
47
subprocess .check_call (cmd , env = env_with_additional_env (additional_env ), stderr = subprocess .STDOUT )
48
48
49
49
50
- def check_output (cmd : List [str ], additional_env : Dict [str , str ] = {}, verbose : bool = False ) -> str :
50
+ def check_output (cmd : List [str ], additional_env : Dict [str , str ] = {}, capture_stderr : bool = True , verbose : bool = False ) -> str :
51
51
if verbose :
52
52
print_cmd (cmd = cmd , additional_env = additional_env )
53
- return subprocess .check_output (cmd , env = env_with_additional_env (additional_env ), stderr = subprocess .STDOUT , encoding = 'utf-8' )
53
+ if capture_stderr :
54
+ stderr = subprocess .STDOUT
55
+ else :
56
+ stderr = subprocess .DEVNULL
57
+ return subprocess .check_output (cmd , env = env_with_additional_env (additional_env ), stderr = stderr , encoding = 'utf-8' )
54
58
55
59
# -----------------------------------------------------------------------------
56
60
# SwiftPM wrappers
@@ -61,7 +65,7 @@ def swiftpm_bin_path(swift_exec: str, swiftpm_args: List[str], additional_env: D
61
65
Return the path of the directory that contains the binaries produced by this package.
62
66
"""
63
67
cmd = [swift_exec , 'build' , '--show-bin-path' ] + swiftpm_args
64
- return check_output (cmd , additional_env = additional_env , verbose = verbose ).strip ()
68
+ return check_output (cmd , additional_env = additional_env , capture_stderr = False , verbose = verbose ).strip ()
65
69
66
70
67
71
def get_build_target (swift_exec : str , args : argparse .Namespace ) -> str :
0 commit comments