load static method

ProjectContext? load(
  1. String startDir
)

Search up from startDir for a srik.yaml and load it. Returns null if no config is found.

Implementation

static ProjectContext? load(String startDir) {
  var current = Directory(startDir).absolute;
  while (true) {
    final yamlFile = File(p.join(current.path, 'srik.yaml'));
    if (yamlFile.existsSync()) {
      return _parse(yamlFile, current.path);
    }
    final parent = current.parent;
    if (parent.path == current.path) {
      return null;
    }
    current = parent;
  }
}