mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-08 16:27:21 +00:00
Refactored RIDs & .NET version
This commit is contained in:
4 files changed
+37
-1
No files matched your search
@@ -2,6 +2,8 @@
|
|||||||
// ReSharper disable UnusedType.Global
|
// ReSharper disable UnusedType.Global
|
||||||
// ReSharper disable UnusedMember.Global
|
// ReSharper disable UnusedMember.Global
|
||||||
|
|
||||||
|
using Build.Tools;
|
||||||
|
|
||||||
namespace Build.Commands;
|
namespace Build.Commands;
|
||||||
|
|
||||||
public sealed class UpdateWebAssetsCommand
|
public sealed class UpdateWebAssetsCommand
|
||||||
@@ -14,7 +16,7 @@ public sealed class UpdateWebAssetsCommand
|
|||||||
|
|
||||||
var rid = Environment.GetRidsForCurrentOS().First();
|
var rid = Environment.GetRidsForCurrentOS().First();
|
||||||
var cwd = Environment.GetAIStudioDirectory();
|
var cwd = Environment.GetAIStudioDirectory();
|
||||||
var contentPath = Path.Join(cwd, "bin", "release", "net9.0", rid, "publish", "wwwroot", "_content");
|
var contentPath = Path.Join(cwd, "bin", "release", Environment.DOTNET_VERSION, rid.ToName(), "publish", "wwwroot", "_content");
|
||||||
var isMudBlazorDirectoryPresent = Directory.Exists(Path.Join(contentPath, "MudBlazor"));
|
var isMudBlazorDirectoryPresent = Directory.Exists(Path.Join(contentPath, "MudBlazor"));
|
||||||
if (!isMudBlazorDirectoryPresent)
|
if (!isMudBlazorDirectoryPresent)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace Build.Tools;
|
|||||||
|
|
||||||
public static class Environment
|
public static class Environment
|
||||||
{
|
{
|
||||||
|
public const string DOTNET_VERSION = "net9.0";
|
||||||
public static readonly Encoding UTF8_NO_BOM = new UTF8Encoding(false);
|
public static readonly Encoding UTF8_NO_BOM = new UTF8Encoding(false);
|
||||||
|
|
||||||
private static readonly string[] ALL_RIDS = ["win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-arm64", "osx-x64"];
|
private static readonly string[] ALL_RIDS = ["win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-arm64", "osx-x64"];
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
namespace Build.Tools;
|
||||||
|
|
||||||
|
public enum RID
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
|
||||||
|
WIN_X64,
|
||||||
|
WIN_ARM64,
|
||||||
|
|
||||||
|
LINUX_X64,
|
||||||
|
LINUX_ARM64,
|
||||||
|
|
||||||
|
OSX_X64,
|
||||||
|
OSX_ARM64,
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
namespace Build.Tools;
|
||||||
|
|
||||||
|
public static class RIDExtensions
|
||||||
|
{
|
||||||
|
public static string ToName(this RID rid) => rid switch
|
||||||
|
{
|
||||||
|
RID.WIN_X64 => "win-x64",
|
||||||
|
RID.WIN_ARM64 => "win-arm64",
|
||||||
|
|
||||||
|
RID.LINUX_X64 => "linux-x64",
|
||||||
|
RID.LINUX_ARM64 => "linux-arm64",
|
||||||
|
|
||||||
|
RID.OSX_X64 => "osx-x64",
|
||||||
|
RID.OSX_ARM64 => "osx-arm64",
|
||||||
|
|
||||||
|
_ => string.Empty,
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in new issue
Block a user