Skip to content

Commit 1c5f28a

Browse files
Combine all args in _runInShell() and also throw exception on bad result code
1 parent 6d58884 commit 1c5f28a

File tree

1 file changed

+8
-2
lines changed
  • packages/flutter_test_runners/lib/src/platform_comms/ios

1 file changed

+8
-2
lines changed

packages/flutter_test_runners/lib/src/platform_comms/ios/xcrun.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,15 @@ class Xcrun {
184184
}
185185

186186
static Future<ProcessResult> _runInShell(List<String> commandAndArgs) async {
187-
print("Sending shell command: '${commandAndArgs.join(" ")}'");
188-
final result = await Process.run("sh", ["--verbose", "--debug", "-c", ...commandAndArgs]);
187+
final command = commandAndArgs.join(" ");
188+
print("Sending shell command: '$command'");
189+
final result = await Process.run("sh", ["--verbose", "--debug", "-c", command]);
189190
print("Shell command exit code: ${result.exitCode}");
191+
192+
if (result.exitCode != 0) {
193+
throw Exception("Failed to execute command in a shell:\n'$command'\nExit code: ${result.exitCode}");
194+
}
195+
190196
return result;
191197

192198
// return Process.run(

0 commit comments

Comments
 (0)