Skip to content

Commit ece7f0b

Browse files
committed
Fixed: Removed 'Mods' folders from Dependency Checks
1 parent efd0cce commit ece7f0b

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

source/Reloaded.Mod.Installer.DependencyInstaller/DependencyInstaller.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,21 @@ public static class DependencyInstaller
1010
/// <param name="reloadedFolderPath">Folder path for an application, library will check every runtimeconfig.json inside this folder.</param>
1111
public static async Task<HashSet<MissingDependency>> GetMissingDependencies(string reloadedFolderPath)
1212
{
13-
var allFiles = Directory.GetFiles(reloadedFolderPath, "*.*", SearchOption.AllDirectories);
13+
// Folders to exclude from dependency scanning
14+
var excludedFolders = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
15+
{
16+
"Apps", "Mods", "Plugins", "User", "Theme", "Assets"
17+
};
18+
19+
var allFiles = Directory.GetFiles(reloadedFolderPath, "*.*", SearchOption.AllDirectories)
20+
.Where(file =>
21+
{
22+
var normalizedBasePath = reloadedFolderPath.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
23+
var relativePath = file.Substring(normalizedBasePath.Length + 1);
24+
var topLevelFolder = relativePath.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)[0];
25+
return !excludedFolders.Contains(topLevelFolder);
26+
})
27+
.ToArray();
1428
var filesWithRuntimeConfigs = allFiles.Where(x => x.EndsWith(".runtimeconfig.json")).ToArray();
1529

1630
// Now that we have the runtime config files, get all missing deps from them.

0 commit comments

Comments
 (0)