Skip to content

Commit f7bb50b

Browse files
committed
fix: compatible with stdout from SPM
1 parent 5d1012c commit f7bb50b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

config/cmd.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ def get_workspace():
119119
cmd = f"xcodebuild -list -json {cmd_target}"
120120
print("run: ", cmd)
121121
output = subprocess.check_output(cmd, shell=True, universal_newlines=True)
122+
if output[0] != "{":
123+
# https://github.com/swiftlang/swift-package-manager/blob/f19d08cf79250514851490599319d22771074b01/Sources/PackageLoading/TargetSourcesBuilder.swift#L194
124+
# SPM print error message to stdout, skip it
125+
start = output.find("{")
126+
output = output[start:]
122127
output = json.loads(output)
123128
if use_project:
124129
scheme = output["project"]["schemes"][0]

0 commit comments

Comments
 (0)