Skip to content

Commit

Permalink
prioritize local hardware packages
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Aug 8, 2024
1 parent 85d5fed commit 9806ff3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,17 @@ public FpgaService(IPaths paths, ILogger logger)

public void RegisterFpgaPackage(IFpgaPackage fpga)
{
var existing = FpgaPackages.FirstOrDefault(x => x.Name == fpga.Name);

if (existing != null) FpgaPackages.Remove(existing);

FpgaPackages.InsertSorted(fpga, (x1, x2) => string.Compare(x1.Name, x2.Name, StringComparison.Ordinal));
}

public void RegisterFpgaExtensionPackage(IFpgaExtensionPackage fpgaExtension)
{
var existing = FpgaExtensionPackages.FirstOrDefault(x => x.Name == fpgaExtension.Name);

//Allow overwrite from folder

if (existing != null) FpgaExtensionPackages.Remove(existing);

FpgaExtensionPackages.InsertSorted(fpgaExtension,
Expand Down Expand Up @@ -119,7 +122,7 @@ public void LoadGenericHardware()

try
{
foreach (var packageDir in Directory.GetDirectories(HardwareDirectory))
foreach (var packageDir in Directory.GetDirectories(HardwareDirectory).OrderBy(x => x != Path.Combine(HardwareDirectory, "Local")))
{
var fpgaDir = Path.Combine(packageDir, "FPGA");

Expand Down

0 comments on commit 9806ff3

Please sign in to comment.