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