loadProjectTrajectorySection function
Loads the PROJECT-level trajectory: section from
<projectDir>/.fah/config.yaml (issue #385 + gh-1745) — the whole
section travels with the repo, the same way wireDump always did.
Null when the file or the section is absent/unreadable; a
present-but-invalid section throws ConfigException (strict, like
the user config).
Implementation
TrajectorySection? loadProjectTrajectorySection(String projectDir) {
final file = File('$projectDir/.fah/config.yaml');
if (!file.existsSync()) return null;
try {
final doc = loadYaml(file.readAsStringSync());
if (doc is! YamlMap) return null;
final node = doc['trajectory'];
return node == null ? null : _parseTrajectorySection(node);
} on ConfigException {
rethrow;
} on Object {
return null;
}
}