Skip to content

Commit

Permalink
Bugfix: Use main exe property value when building corerun full execut…
Browse files Browse the repository at this point in the history
…able path.
  • Loading branch information
peters committed Sep 14, 2020
1 parent c10ff6e commit 4cfcdb3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Snap/Extensions/SnapExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,11 @@ internal static SnapApp BuildSnapApp([NotNull] this SnapApps snapApps, string id
throw new Exception("Supervisor id cannot be an empty guid.");
}

if (snapApp.MainExe != null && string.IsNullOrWhiteSpace(snapApp.MainExe))
{
throw new Exception("MainExe property cannot be null or whitespace.");
}

var snapAppUniqueRuntimeIdentifiers = snapApp.Targets.Select(x => x.Rid).ToList();
if (snapAppUniqueRuntimeIdentifiers.Distinct().Count() != snapApp.Targets.Count)
{
Expand Down Expand Up @@ -759,7 +764,7 @@ internal static void GetCoreRunExecutableFullPath([NotNull] this SnapApp snapApp
if (snapFilesystem == null) throw new ArgumentNullException(nameof(snapFilesystem));
if (baseDirectory == null) throw new ArgumentNullException(nameof(baseDirectory));

var exeName = snapApp.Id;
var exeName = snapApp.MainExe ?? snapApp.Id;
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
exeName += ".exe";
Expand Down

0 comments on commit 4cfcdb3

Please sign in to comment.