repository property

Directory? repository

The git repository root the sidekickPackage is located in

It may return null when there's not git repository. In most cases it is better to use projectRoot instead.

Why would there not be a git repository? Code can be downloaded as a zip file (from github) or may be hosted in a non-git mono repository. Anyways, your sidekick CLI should always be functional.

Implementation

static Directory? get repository {
  return _cache.getOrCreate('findRepository', _findRepository);
}