Skip to content

Commit 6701bbc

Browse files
update fuchsia-attach (flutter#29764)
1 parent 40cbdd1 commit 6701bbc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/flutter_tools/bin/fuchsia_attach.dart

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ final ArgParser parser = ArgParser()
2323
..addOption('target', help: 'The GN target to attach to')
2424
..addOption('entrypoint', defaultsTo: 'main.dart', help: 'The filename of the main method. Defaults to main.dart')
2525
..addOption('device', help: 'The device id to attach to')
26+
..addOption('dev-finder', help: 'The location of the dev_finder binary')
2627
..addFlag('verbose', negatable: true);
2728

2829
// Track the original working directory so that the tool can find the
@@ -40,7 +41,7 @@ Future<void> main(List<String> args) async {
4041
final String buildDirectory = argResults['build-dir'];
4142
final File frontendServer = fs.file('$buildDirectory/host_x64/gen/third_party/flutter/frontend_server/frontend_server_tool.snapshot');
4243
final File sshConfig = fs.file('$buildDirectory/ssh-keys/ssh_config');
43-
final File devFinder = fs.file('$buildDirectory/host_x64/dev_finder');
44+
final File devFinder = fs.file(argResults['dev-finder']);
4445
final File platformKernelDill = fs.file('$buildDirectory/flutter_runner_patched_sdk/platform_strong.dill');
4546
final File flutterPatchedSdk = fs.file('$buildDirectory/flutter_runner_patched_sdk');
4647
final String packages = '$buildDirectory/dartlang/gen/$path/${name}_dart_library.packages';
@@ -51,6 +52,19 @@ Future<void> main(List<String> args) async {
5152
originalWorkingDirectory = fs.currentDirectory.path;
5253
fs.currentDirectory = path;
5354

55+
if (!devFinder.existsSync()) {
56+
print('Error: dev_finder not found at ${devFinder.path}.');
57+
return 1;
58+
}
59+
if (!frontendServer.existsSync()) {
60+
print(
61+
'Error: frontend_server not found at ${frontendServer.path}. This '
62+
'Usually means you ran fx set without specifying '
63+
'--args=flutter_profile=true.'
64+
);
65+
return 1;
66+
}
67+
5468
// Check for a package with a lib directory.
5569
final String entrypoint = argResults['entrypoint'];
5670
String targetFile = 'lib/$entrypoint';

0 commit comments

Comments
 (0)