1111//.title~
1212
1313import 'package:df_gen_core/df_gen_core.dart' ;
14+ // ignore: implementation_imports
15+ import 'package:df_config/src/_etc/replace_data.dart' ;
1416
1517import 'package:path/path.dart' as p;
1618
@@ -44,7 +46,7 @@ Future<void> genIndexesTs(
4446
4547 final help = argResults.flag (DefaultFlags .HELP .name);
4648 if (help) {
47- _print (printCyan, parser.getInfo (argParser));
49+ _print (Glog . printCyan, parser.getInfo (argParser));
4850 exit (ExitCodes .SUCCESS .code);
4951 }
5052
@@ -57,7 +59,7 @@ Future<void> genIndexesTs(
5759 templates = argResults.multiOption (DefaultMultiOptions .TEMPLATES .name);
5860 } catch (_) {
5961 _print (
60- printRed,
62+ Glog . printRed,
6163 'Missing required args! Use --help flag for more information.' ,
6264 );
6365 exit (ExitCodes .FAILURE .code);
@@ -70,7 +72,7 @@ Future<void> genIndexesTs(
7072
7173 // ---------------------------------------------------------------------------
7274
73- _print (printWhite, 'Looking for files..' );
75+ _print (Glog . printWhite, 'Looking for files..' );
7476 final filePathStream0 = PathExplorer (inputPath).exploreFiles ();
7577 final filePathStream1 = filePathStream0.where ((e) {
7678 print (e);
@@ -82,34 +84,33 @@ Future<void> genIndexesTs(
8284 try {
8385 findings = await filePathStream1.toList ();
8486 } catch (e) {
85- _print (printRed, 'Failed to read file tree!' , spinner);
87+ _print (Glog . printRed, 'Failed to read file tree!' , spinner);
8688 exit (ExitCodes .FAILURE .code);
8789 }
8890 if (findings.isEmpty) {
8991 spinner.stop ();
90- _print (printYellow, 'No files found in $inputPath !' );
92+ _print (Glog . printYellow, 'No files found in $inputPath !' );
9193 exit (ExitCodes .SUCCESS .code);
9294 }
9395
9496 // ---------------------------------------------------------------------------
9597
9698 final templateData = < String , String > {};
9799 for (final template in templates) {
98- _print (printWhite, 'Reading template at: $template ...' );
99- final result =
100- await MdTemplateUtility .i.readTemplateFromPathOrUrl (template).value;
100+ _print (Glog .printWhite, 'Reading template at: $template ...' );
101+ final result = await MdTemplateUtility .i.readTemplateFromPathOrUrl (template).value;
101102
102103 if (result.isErr ()) {
103104 spinner.stop ();
104- _print (printRed, ' Failed to read template!' );
105+ _print (Glog . printRed, ' Failed to read template!' );
105106 exit (ExitCodes .FAILURE .code);
106107 }
107108 templateData[template] = result.unwrap ();
108109 }
109110
110111 // ---------------------------------------------------------------------------
111112
112- _print (printWhite, 'Generating...' , spinner);
113+ _print (Glog . printWhite, 'Generating...' , spinner);
113114
114115 for (final entry in templateData.entries) {
115116 final fileName = p.basename (entry.key).replaceAll ('.md' , '' );
@@ -124,11 +125,11 @@ Future<void> genIndexesTs(
124125 (e) => 'export * from \' ./$e \' ;' ,
125126 ),
126127 });
127- _print (printWhite, 'Writing output to $fileName ...' , spinner);
128+ _print (Glog . printWhite, 'Writing output to $fileName ...' , spinner);
128129 try {
129130 await FileSystemUtility .i.writeLocalFile (fileName, data);
130131 } catch (e) {
131- _print (printRed, 'Failed to write at: $fileName ' , spinner);
132+ _print (Glog . printRed, 'Failed to write at: $fileName ' , spinner);
132133 exit (ExitCodes .FAILURE .code);
133134 }
134135 }
@@ -137,7 +138,7 @@ Future<void> genIndexesTs(
137138
138139 // [STEP 11] Print success!
139140 spinner.stop ();
140- _print (printGreen, 'Done!' );
141+ _print (Glog . printGreen, 'Done!' );
141142}
142143
143144// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
0 commit comments