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 {
  // FIXME: if gitRootDir is not valid give an error!
  var gitRootDir = GitRepository.findRootDir(Directory.current.path)!;
  var repo = await GitRepository.load(gitRootDir);

  var pathSpec = argResults!.arguments[0];
  await repo.add(pathSpec);

  // FIXME: Get proper pathSpec
  // FIXME: Handle glob patterns
  // FIXME: Handle .
}