@@ -23,6 +23,7 @@ final ArgParser parser = ArgParser()
23
23
..addOption ('target' , help: 'The GN target to attach to' )
24
24
..addOption ('entrypoint' , defaultsTo: 'main.dart' , help: 'The filename of the main method. Defaults to main.dart' )
25
25
..addOption ('device' , help: 'The device id to attach to' )
26
+ ..addOption ('dev-finder' , help: 'The location of the dev_finder binary' )
26
27
..addFlag ('verbose' , negatable: true );
27
28
28
29
// Track the original working directory so that the tool can find the
@@ -40,7 +41,7 @@ Future<void> main(List<String> args) async {
40
41
final String buildDirectory = argResults['build-dir' ];
41
42
final File frontendServer = fs.file ('$buildDirectory /host_x64/gen/third_party/flutter/frontend_server/frontend_server_tool.snapshot' );
42
43
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' ] );
44
45
final File platformKernelDill = fs.file ('$buildDirectory /flutter_runner_patched_sdk/platform_strong.dill' );
45
46
final File flutterPatchedSdk = fs.file ('$buildDirectory /flutter_runner_patched_sdk' );
46
47
final String packages = '$buildDirectory /dartlang/gen/$path /${name }_dart_library.packages' ;
@@ -51,6 +52,19 @@ Future<void> main(List<String> args) async {
51
52
originalWorkingDirectory = fs.currentDirectory.path;
52
53
fs.currentDirectory = path;
53
54
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
+
54
68
// Check for a package with a lib directory.
55
69
final String entrypoint = argResults['entrypoint' ];
56
70
String targetFile = 'lib/$entrypoint ' ;
0 commit comments