-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(create): add Dart CLI template (#431)
- Loading branch information
1 parent
f85da74
commit 1c3a5f0
Showing
7 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
lib/src/commands/create/templates/very_good_dart_cli/very_good_dart_cli.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export 'very_good_dart_cli_bundle.dart'; | ||
export 'very_good_dart_cli_template.dart'; |
151 changes: 151 additions & 0 deletions
151
lib/src/commands/create/templates/very_good_dart_cli/very_good_dart_cli_bundle.dart
Large diffs are not rendered by default.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
lib/src/commands/create/templates/very_good_dart_cli/very_good_dart_cli_template.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import 'dart:io'; | ||
|
||
import 'package:mason_logger/mason_logger.dart'; | ||
import 'package:very_good_cli/src/commands/create/templates/templates.dart'; | ||
|
||
/// {@template dart_cli_template} | ||
/// A Dart CLI application template. | ||
/// {@endtemplate} | ||
class VeryGoodDartCLITemplate extends Template { | ||
/// {@macro dart_cli_template} | ||
VeryGoodDartCLITemplate() | ||
: super( | ||
name: 'dart_cli', | ||
bundle: veryGoodDartCliBundle, | ||
help: 'Generate a Very Good Dart CLI application.', | ||
); | ||
|
||
@override | ||
Future<void> onGenerateComplete(Logger logger, Directory outputDir) async { | ||
await installDartPackages(logger, outputDir); | ||
await applyDartFixes(logger, outputDir); | ||
_logSummary(logger); | ||
} | ||
|
||
void _logSummary(Logger logger) { | ||
logger | ||
..info('\n') | ||
..alert('Created a Very Good Dart CLI application! 🦄') | ||
..info('\n'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters