From 53facde0d03f32c25352ea52ca7c6e0c13cdac1b Mon Sep 17 00:00:00 2001 From: Daco Harkes Date: Wed, 1 Nov 2023 15:58:35 +0100 Subject: [PATCH] [native_toolchain_c] Fix NDK discovery (#179) --- pkgs/native_toolchain_c/lib/src/tool/tool_resolver.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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; }