Skip to content

Commit 695216e

Browse files
committed
v6.7.1
1 parent 5167d27 commit 695216e

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
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 🚀

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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:

lib/metro/ny_cli.dart

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,35 @@ export 'package:dio/dio.dart';
1717
/// Base class for custom commands
1818
abstract 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('\nUsage:');
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

lib/nylo_framework.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ export 'package:date_field/date_field.dart';
2929
export 'package:dio/dio.dart';
3030

3131
/// Nylo version
32-
const String nyloVersion = 'v6.7.0';
32+
const String nyloVersion = 'v6.7.1';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nylo_framework
22
description: Micro-framework for Flutter that's built to simplify app development for Flutter projects.
3-
version: 6.7.0
3+
version: 6.7.1
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/framework/tree/6.x
66
issue_tracker: https://github.com/nylo-core/framework/issues

0 commit comments

Comments
 (0)