doRun method

  1. @override
Future<int> doRun()
override

Implementation

@override
Future<int> doRun() async {
  final args = argResults!;
  final runDirPath = path.current;
  final config = findConfigAndSetWorkingDir();
  final l10nConfig = config.l10n;

  final target = args[_argFrom] as String;
  final baseLocale =
      args[_argLocale] as String? ?? l10nConfig.baseLocaleForXml;

  switch (target) {
    case _sourceArb:
      return _exportArb(l10nConfig, baseLocale);
    case _sourceJson:
      return _exportJson(l10nConfig, baseLocale);
    case _sourceIos:
      return _exportIos(l10nConfig, baseLocale, {path.current, runDirPath});
    default:
      return error(1, message: 'Unknown target: $target');
  }
}