process method

  1. @override
void process(
  1. String? path
)
override

Implementation

@override
void process(String? path) {
  print('Index: ${config!.dir}');
  final outFileName = config!.outputFile ?? 'index.dart';
  var paths = listFiles(config!.dir!, config!.recursive!)
      .map((i) => p.relative(i!, from: config!.dir))
      .toList();
  paths.remove(outFileName);
  if (paths.isEmpty) return null;
  final exports = paths.map((i) => "export '$i';");
  final outFilePath = p.join(config!.dir!, outFileName);

  try {
    var output = formatCode(exports.join('\n'));
    fileWriteString(outFilePath, output);
  } catch (e) {
    print(e);
    return;
  }

  _lastGenerated = outFilePath;
}