execute method

Future<void> execute()

Implementation

Future<void> execute() async {
  stdout.writeln('πŸ”„ Your first sync! Uploading all the files...');
  final files = _fileManager.supportedLocalizationFiles;

  stdout.write('πŸ”„ ');
  await Future.wait(files.map((file) async {
    final locale = _fileManager.getLocaleByPath(file.path);
    final bytes = await File(file.path).readAsBytes();

    if (locale.isNotEmpty) {
      stdout.write('$locale, ');
      await _resourcesApi.uploadResourcesFile(_configManager.projectId, locale, bytes);
    }
  }));
  stdout.writeln('\nπŸ”„ All files uploaded!\n');
}