Skip to content

Commit

Permalink
支持dotnet-hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed May 22, 2024
1 parent 2cce5e5 commit 347a28d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions EasyWeb/Services/EntryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ String GetVersion(String name)

if (name.Contains('-'))
{
var p = name.LastIndexOf("-win-");
if (p < 0) p = name.LastIndexOf("-linux-");
if (p < 0) p = name.LastIndexOf("-osx-");
var p = name.LastIndexOf("-win");
if (p < 0) p = name.LastIndexOf("-linux");
if (p < 0) p = name.LastIndexOf("-osx");
if (p < 0) return null;

name = name[..p];
Expand Down
11 changes: 6 additions & 5 deletions EasyWeb/Services/ScanSourceService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,17 @@ public void CreateLinks(Int32 storageId)

var childs = FileEntry.FindAllByParentId(root.Id);

var kinds = new[] { "aspnetcore-runtime", "dotnet-runtime", "windowsdesktop-runtime" };
var kinds = new[] { "aspnetcore-runtime", "dotnet-runtime", "windowsdesktop-runtime", "dotnet-hosting" };
var rids = new[] {
"win-x86", "win-x64", "win-arm64",
"win-x86", "win-x64", "win-arm64", "win",
"linux-x64", "linux-arm", "linux-arm64",
"linux-musl-x64", "linux-musl-arm", "linux-musl-arm64",
"osx-x64", "osx-arm64",
};

var last = FileEntry.FindAllByParentId(childs.OrderByDescending(e => e.Version).FirstOrDefault()?.Id ?? -1);
var tags = last.Where(e => !e.Tag.IsNullOrEmpty()).Select(e => e.Tag).Distinct().ToList();
var last = childs.OrderByDescending(e => e.Version).FirstOrDefault();
var childs2 = FileEntry.FindAllByParentId(last?.Id ?? -1);
var tags = childs2.Where(e => !e.Tag.IsNullOrEmpty()).Select(e => e.Tag).Distinct().ToList();

// 遍历所有组合
foreach (var k in kinds)
Expand All @@ -265,7 +266,7 @@ public void CreateLinks(Int32 storageId)
if (tags.Contains(tag))
{
var ext = "";
if (r.StartsWith("win-"))
if (r.StartsWith("win"))
ext = ".exe";
else if (r.StartsWith("linux-"))
ext = ".tar.gz";
Expand Down

0 comments on commit 347a28d

Please sign in to comment.