mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-04-28 11:39:48 +00:00
Refactored RIDs & .NET version
This commit is contained in:
parent
92ed4fcb9d
commit
f1b5b9e350
@ -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"];
|
||||||
|
15
app/Build/Tools/RID.cs
Normal file
15
app/Build/Tools/RID.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
namespace Build.Tools;
|
||||||
|
|
||||||
|
public enum RID
|
||||||
|
{
|
||||||
|
NONE,
|
||||||
|
|
||||||
|
WIN_X64,
|
||||||
|
WIN_ARM64,
|
||||||
|
|
||||||
|
LINUX_X64,
|
||||||
|
LINUX_ARM64,
|
||||||
|
|
||||||
|
OSX_X64,
|
||||||
|
OSX_ARM64,
|
||||||
|
}
|
18
app/Build/Tools/RIDExtensions.cs
Normal file
18
app/Build/Tools/RIDExtensions.cs
Normal file
@ -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,
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user