findFirstExistingOdbcEnginePath function

  1. @visibleForTesting
String? findFirstExistingOdbcEnginePath({
  1. required String cwd,
  2. String? packageRoot,
})

First existing local release path: cwd before packageRoot, workspace before crate-local. Does not consult Native Assets or PATH.

Implementation

@visibleForTesting
String? findFirstExistingOdbcEnginePath({
  required String cwd,
  String? packageRoot,
}) {
  final name = _libraryName();
  final sep = Platform.pathSeparator;
  final fromCwd = _existingPathUnderRoot(cwd, name, sep);
  if (fromCwd != null) {
    return fromCwd;
  }
  if (packageRoot != null && packageRoot != cwd) {
    return _existingPathUnderRoot(packageRoot, name, sep);
  }
  return null;
}