Skip to content

Commit

Permalink
feat: display command to run to use config file
Browse files Browse the repository at this point in the history
If custom file name is used, then only add `-f` flag to keep it clear
  • Loading branch information
OutdatedGuy authored and MarkOSullivan94 committed Apr 10, 2023
1 parent 027b9ab commit 8394fd6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions bin/generate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:args/args.dart';
import 'package:flutter_launcher_icons/constants.dart';
import 'package:flutter_launcher_icons/src/version.dart';

const _defaultConfigFileName = './flutter_launcher_icons.yaml';

/// The function will be called from command line
/// using the following command:
/// ```sh
Expand All @@ -31,7 +33,7 @@ void main(List<String> arguments) {
..addOption(
'fileName',
abbr: 'f',
defaultsTo: './flutter_launcher_icons.yaml',
defaultsTo: _defaultConfigFileName,
);

final results = parser.parse(arguments);
Expand Down Expand Up @@ -67,7 +69,13 @@ void main(List<String> arguments) {
void _generateConfigFile(File configFile) {
try {
configFile.writeAsStringSync(_configFileTemplate);
print('Config file generated successfully');

print('\nConfig file generated successfully 🎉');
print(
'You can now use this new config file by using the command below:\n\n'
'flutter pub run flutter_launcher_icons'
'${configFile.path == _defaultConfigFileName ? '' : ' -f ${configFile.path}'}\n',
);
} on Exception catch (e) {
print('Error generating config file: $e');
}
Expand Down

0 comments on commit 8394fd6

Please sign in to comment.