Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikMennen committed Mar 19, 2024
1 parent 55b3928 commit dae495b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/OneWare.Ghdl/Services/GhdlService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public GhdlService(ILogger logger, IDockService dockService, ISettingsService se
private async Task<(bool success, string output)> ExecuteGhdlAsync(IReadOnlyCollection<string> arguments, string workingDirectory, string status,
AppState state = AppState.Loading, bool showTimer = false)
{
if (!File.Exists(_path))
if (!File.Exists(_path) || (_settingsService.GetSettingValue<bool>("Experimental_AutoDownloadBinaries") &&
_packageService.Packages.GetValueOrDefault(GhdlModule.GhdlPackage.Id!) is {Status: PackageStatus.Available or PackageStatus.UpdateAvailable or PackageStatus.Installing}))
{
var install = await InstallGhdlAsync();
if (!install) return (false,string.Empty);
Expand All @@ -86,13 +87,10 @@ private async Task<bool> InstallGhdlAsync()
{
if (!_settingsService.GetSettingValue<bool>("Experimental_AutoDownloadBinaries")) return false;
if(!await _packageService.InstallAsync(GhdlModule.GhdlPackage)) return false;
}
var result = await _packageService.InstallAsync(GhdlModule.GhdlPackage);
if (result)
{
SetEnvironment();
return true;
}

return false;
}

Expand Down

0 comments on commit dae495b

Please sign in to comment.