File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
import 'dart:async' ;
2
+ import 'dart:io' ;
2
3
3
4
import 'package:celest_cli_common/celest_cli_common.dart' ;
4
5
import 'package:cli_script/cli_script.dart' ;
@@ -33,6 +34,9 @@ Future<void> runPub({
33
34
},
34
35
workingDirectory: workingDirectory,
35
36
);
37
+ // TODO(dnys1): Remove when fixed in pub https://github.com/dart-lang/sdk/issues/55289
38
+ // and we can rely on the exit code taking a reasonable amount of time.
39
+
36
40
// Must be sync so that completer only completes once before `finally` block
37
41
// cancels subscription.
38
42
final completer = Completer <void >.sync ();
@@ -62,7 +66,18 @@ Future<void> runPub({
62
66
);
63
67
}
64
68
}),
65
- completer.future,
69
+ completer.future.then ((_) {
70
+ final packageConfig = fileSystem
71
+ .directory (workingDirectory)
72
+ .childDirectory ('.dart_tool' )
73
+ .childFile ('package_config.json' );
74
+ if (packageConfig.existsSync ()) {
75
+ return Future <void >.value ();
76
+ }
77
+ return packageConfig
78
+ .watch ()
79
+ .firstWhere ((event) => event.type == FileSystemEvent .create);
80
+ }),
66
81
]);
67
82
} finally {
68
83
unawaited (stdout.cancel ());
You can’t perform that action at this time.
0 commit comments