repoRoot function

Future<String?> repoRoot({
  1. String? dir,
})

Get the repository root directory.

Implementation

Future<String?> repoRoot({String? dir}) async {
  final result = await runGit([
    'rev-parse',
    '--show-toplevel',
  ], workingDirectory: dir);
  return result.success ? result.output : null;
}