File tree Expand file tree Collapse file tree 5 files changed +21
-7
lines changed
Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 1+ ## [ 6.7.1] - 2025-04-09
2+
3+ * Update ` builder ` in NyCustomCommand class
4+
15## [ 6.7.0] - 2025-04-08
26
37* Added: ` make:command ` to metro cli so you can create custom commands in Nylo 🚀
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ packages:
427427 path: ".."
428428 relative: true
429429 source: path
430- version: "6.7.0 "
430+ version: "6.7.1 "
431431 nylo_support:
432432 dependency: transitive
433433 description:
Original file line number Diff line number Diff line change @@ -17,25 +17,35 @@ export 'package:dio/dio.dart';
1717/// Base class for custom commands
1818abstract class NyCustomCommand {
1919 /// Define the command configuration
20- CommandBuilder get builder;
20+ CommandBuilder builder (CommandBuilder commandBuilder) => commandBuilder;
21+
22+ CommandBuilder ? _builder;
2123
2224 List <String > arguments;
2325
2426 /// Execute the command with parsed results
2527 Future <void > handle (CommandResult result);
2628
27- NyCustomCommand (this .arguments);
29+ NyCustomCommand (this .arguments) {
30+ CommandBuilder commandBuilder = CommandBuilder ();
31+ _builder = builder (commandBuilder);
32+ }
2833
2934 /// Run the command
3035 run () {
36+ assert (
37+ _builder != null ,
38+ 'CommandBuilder must be initialized before running the command.' ,
39+ );
40+
3141 // Handle help flag
3242 if (arguments.contains ('--help' ) || arguments.contains ('-h' )) {
3343 print ('\n Usage:' );
34- print (builder .usage);
44+ print (_builder ! .usage);
3545 return ;
3646 }
3747
38- final CommandResult result = builder .parse (arguments);
48+ final CommandResult result = _builder ! .parse (arguments);
3949 handle (result);
4050 }
4151
Original file line number Diff line number Diff line change @@ -29,4 +29,4 @@ export 'package:date_field/date_field.dart';
2929export 'package:dio/dio.dart' ;
3030
3131/// Nylo version
32- const String nyloVersion = 'v6.7.0 ' ;
32+ const String nyloVersion = 'v6.7.1 ' ;
Original file line number Diff line number Diff line change 11name : nylo_framework
22description : Micro-framework for Flutter that's built to simplify app development for Flutter projects.
3- version : 6.7.0
3+ version : 6.7.1
44homepage : https://nylo.dev
55repository : https://github.com/nylo-core/framework/tree/6.x
66issue_tracker : https://github.com/nylo-core/framework/issues
You can’t perform that action at this time.
0 commit comments