Ignore hidden files when generating the unused files list.

Don't include hidden files in the unused file list for a mod. These files are typically things such as .git or otherwise intended to be hidden and shouldn't be included as part of the list of files which could be used.
This commit is contained in:
Jacob Keller 2023-04-11 20:47:40 -07:00 committed by Ottermandias
parent 51ce6d1038
commit 8c28f0c6e3

View file

@ -65,6 +65,7 @@ public partial class Mod
var modFiles = AllFiles.ToHashSet();
return ModPath.EnumerateDirectories()
.SelectMany( f => f.EnumerateFiles( "*", SearchOption.AllDirectories ) )
.Where( f => !f.Attributes.HasFlag( FileAttributes.Hidden ) )
.Select( f => new FullPath( f ) )
.Where( f => !modFiles.Contains( f ) )
.ToList();
@ -142,4 +143,4 @@ public partial class Mod
IModGroup.Save( group, ModPath, index );
}
}
}
}