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();
  var hash = await repo.writeTree(index);
  print(hash);
}