Skip to content

Commit 6564794

Browse files
authored
Avoid using relative path in Process.start (#193664)
Issue: #193579. This is a fix for the following error: ``` Processing /Volumes/Work/s/w/ir/x/w/flutter/bin/cache/pkg/tests/registry/flutter_cocoon.test... Unhandled exception: ProcessException: No such file or directory Command: ./test_utilities/bin/flutter_test_runner.sh dashboard #0 _ProcessImpl._start (dart:io-patch/process_patch.dart:411:33) #1 Process.start (dart:io-patch/process_patch.dart:42:20) #2 shell (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/customer_testing/lib/runner.dart:236:29) #3 runTests (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/customer_testing/lib/runner.dart:172:31) <asynchronous suspension> #4 main (file:///Volumes/Work/s/w/ir/x/w/flutter/dev/customer_testing/run_tests.dart:15:8) <asynchronous suspension> ```
1 parent 65afe58 commit 6564794

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

‎dev/customer_testing/lib/runner.dart‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,6 @@ Future<bool> runTests({
212212
return true;
213213
}
214214

215-
final RegExp _spaces = RegExp(r' +');
216-
217215
Future<bool> shell(
218216
String command,
219217
Directory directory, {
@@ -232,12 +230,11 @@ Future<bool> shell(
232230
command,
233231
], workingDirectory: directory.path);
234232
} else {
235-
final List<String> segments = command.trim().split(_spaces);
236-
process = await Process.start(
237-
segments.first,
238-
segments.skip(1).toList(),
239-
workingDirectory: directory.path,
240-
);
233+
process = await Process.start('/usr/bin/env', <String>[
234+
'bash',
235+
'-c',
236+
command,
237+
], workingDirectory: directory.path);
241238
}
242239
final output = <String>[];
243240
utf8.decoder

0 commit comments

Comments
 (0)