@@ -11,30 +11,31 @@ typedef RouteConfigurationBuilder = RouteConfiguration Function(
1111 io.Directory directory,
1212);
1313
14+ void _defaultExit (int code) => ExitOverrides .current? .exit ?? io.exit;
15+
1416Future <void > run (HookContext context) => preGen (context);
1517
1618Future <void > preGen (
1719 HookContext context, {
1820 io.Directory ? directory,
1921 RouteConfigurationBuilder buildConfiguration = buildRouteConfiguration,
20- void Function (int exitCode)? exit,
22+ void Function (int exitCode) exit = _defaultExit ,
2123}) async {
22- final _exit = exit ?? ExitOverrides .current? .exit ?? io.exit;
2324 final projectDirectory = directory ?? io.Directory .current;
2425
25- await createBundle (context, projectDirectory, _exit );
26+ await createBundle (context, projectDirectory, exit );
2627
2728 final RouteConfiguration configuration;
2829 try {
2930 configuration = buildConfiguration (projectDirectory);
3031 } catch (error) {
3132 context.logger.err ('$error ' );
32- return _exit (1 );
33+ return exit (1 );
3334 }
3435
35- reportRouteConflicts (context, configuration, _exit );
36- reportRogueRoutes (context, configuration, _exit );
37- await reportExternalPathDependencies (context, projectDirectory, _exit );
36+ reportRouteConflicts (context, configuration, exit );
37+ reportRogueRoutes (context, configuration, exit );
38+ await reportExternalPathDependencies (context, projectDirectory, exit );
3839
3940 context.vars = {
4041 'directories' : configuration.directories
0 commit comments