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 objectSha1 = argResults!.arguments[1];
  var objRes = await repo.objStorage.read(GitHash(objectSha1));
  var obj = objRes.get();
  if (obj is GitBlob) {
    var s = utf8.decode(obj.blobData);
    print(s);
  }
}