Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
update appx logic for new packages on github
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF6 committed May 9, 2020
1 parent 261dfb6 commit 9eb78c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Rune.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<RootNamespace>Rune.CLI</RootNamespace>
<ApplicationIcon>resource\icon.ico</ApplicationIcon>
<StartupObject></StartupObject>
<Version>0.70.617-beta</Version>
<Version>0.70.618-beta</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
Expand Down
11 changes: 6 additions & 5 deletions src/etc/Appx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async ValueTask<FileInfo> DownloadAsync()
.WithHeader("User-Agent", $"RuneCLI/{HelpCommand.GetVersion()}")
.GetJsonAsync<GithubRelease[]>();
var release = releases.First();
var targetFile = Config.Get($"github_{_type}", "file", $"{_type}-{OS}.zip");
var targetFile = Config.Get($"github_{_type}", "file", $"{_type}-{OS}-{Arch}.zip");

var asset = release.Assets.FirstOrDefault(x => x.Name == targetFile);

Expand All @@ -56,7 +56,8 @@ public async ValueTask<FileInfo> DownloadAsync()
return new FileInfo(Path.Combine(Dirs.CacheFolder.FullName, targetFile));
}


private string Arch
=> RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant();
private string OS
{
get
Expand All @@ -65,11 +66,11 @@ private string OS
throw new NotSupportedException($"{RuntimeInformation.ProcessArchitecture} is not support.");

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
return "win64";
return "win10";
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
return "linux64";
return "linux";
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
return "osx64";
return $"osx.10.14";
throw new NotSupportedException($"{RuntimeInformation.OSDescription} is not support.");
}
}
Expand Down

0 comments on commit 9eb78c6

Please sign in to comment.