extractStrings function

Future<void> extractStrings()

Logic for fts extract

Implementation

Future<void> extractStrings() async {
  if (libFolder.isEmpty) {
    libFolder = p.absolute('.');
  }
  // trace("Extracting permissive: ", extractPermissive, ' files:',
  //     extractAllowedExtensions);
  libFolder = p.canonicalize(libFolder);
  if (!p.split(libFolder).contains('lib')) {
    trace('''WARNING: fts is not finding /lib in the current search path.
As it uses brute-force approach for String matching and file access, if the program takes much time,
cancel the operation and pass --path argument to run a faster analysis.
Or change the current working directory to /lib or some sub-folder.
''');
  }
  if (!exists(libFolder)) {
    error(
        'Folder $libFolder doesn\'t exists. Please select a valid /lib folder to extract Strings.');
    exit(3);
  }
  if (extractStringOutputFile.isEmpty) {
    error('Please set the --output parameter to save strings.json');
    exit(3);
  }
  _inspectRecursive(libFolder);
}