isPathTrusted method

bool isPathTrusted(
  1. String dir
)

Check if a path is trusted (walks parents).

Implementation

bool isPathTrusted(String dir) {
  final config = getGlobalConfig();
  var currentPath = _normalizePathForConfigKey(p.normalize(dir));
  while (true) {
    if (config.projects?[currentPath]?.hasTrustDialogAccepted == true) {
      return true;
    }
    final parentPath = _normalizePathForConfigKey(
      p.normalize(p.join(currentPath, '..')),
    );
    if (parentPath == currentPath) return false;
    currentPath = parentPath;
  }
}