From bde913fed0c5528c5e16ee7a2a3321c78e47685d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=A8=87?= Date: Mon, 4 Mar 2024 22:52:01 +0800 Subject: [PATCH] Update windows_evb_config_generator.dart --- dev/windows_evb_config_generator.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dev/windows_evb_config_generator.dart b/dev/windows_evb_config_generator.dart index 2ce2c6e..5c2e6ec 100644 --- a/dev/windows_evb_config_generator.dart +++ b/dev/windows_evb_config_generator.dart @@ -82,12 +82,13 @@ void buildDir(XmlBuilder builder, String name, List entities) builder.element('OverwriteAttributes', nest: 'False'); builder.element('HideFromDialogs', nest: 0); builder.element('Files', nest: () { - for (final dir in entities.whereType()) { - buildDir(builder, dir.name, dir.listSync()); - } + for (final entity in entities) { + if (entity is Directory) { + buildDir(builder, entity.name, entity.listSync()); + } else if (entity is File) { + buildFile(builder, entity.name, entity.absolute.path); - for (final file in entities.whereType()) { - buildFile(builder, file.name, file.absolute.path); + } } }); });