findOrmConfigFile function
Finds the ormed.yaml file by searching from startDirectory up to the
filesystem root.
Returns null if no ormed.yaml is found.
Implementation
File? findOrmConfigFile([Directory? startDirectory]) {
var current = startDirectory ?? Directory.current;
while (true) {
final candidate = File('${current.path}/ormed.yaml');
if (candidate.existsSync()) {
return candidate;
}
final parent = current.parent;
if (parent.path == current.path) {
// Reached filesystem root
return null;
}
current = parent;
}
}