diff --git a/pkgs/native_toolchain_c/lib/src/tool/tool_resolver.dart b/pkgs/native_toolchain_c/lib/src/tool/tool_resolver.dart index 5a5e67099..257ef8ee1 100644 --- a/pkgs/native_toolchain_c/lib/src/tool/tool_resolver.dart +++ b/pkgs/native_toolchain_c/lib/src/tool/tool_resolver.dart @@ -224,9 +224,13 @@ class InstallLocationResolver implements ToolResolver { final result = []; final fileSystemEntities = await Glob(path).list().toList(); for (final fileSystemEntity in fileSystemEntities) { - if (await fileSystemEntity.exists()) { - result.add(fileSystemEntity.uri); + if (!await fileSystemEntity.exists()) { + continue; } + if (fileSystemEntity is! Directory && path.endsWith('/')) { + continue; + } + result.add(fileSystemEntity.uri); } return result; }