run method

  1. @override
Future run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
Future run() async {
  var gitRootDir = GitRepository.findRootDir(Directory.current.path)!;
  var repo = await GitRepository.load(gitRootDir);

  var index = await repo.indexStorage.readIndex();
  print('Index Version: ${index.versionNo}');
  for (var entry in index.entries) {
    var str = entry.toString();
    str = str.replaceAll(',', ',\n\t');
    str = str.replaceAll('{', '{\n\t');
    str = str.replaceAll('}', '\n}');
    print(str);
  }
}