From 5644380e4a25c5ce131fe9abf84e67b54a61773b Mon Sep 17 00:00:00 2001
From: Feiron <53085628+fr1g@users.noreply.github.com>
Date: Thu, 23 Mar 2023 16:33:17 +0800
Subject: [PATCH 1/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=BD=AF=E9=93=BE?=
=?UTF-8?q?=E5=B7=A5=E5=85=B7=E5=92=8Cshell=E5=B7=A5=E5=85=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 添加了软链工具和创建软链的方法, 将在下次添加删除方法。
- 添加了执行命令的方法。
- 尝试在SystemInfoHelper添加统合的全平台系统信息获取工具(至少有个系统版本吧)
---
.../Class/Helper/CommandLineHelper.cs | 83 +++++++++++++++++++
.../ProjBobcat/Class/Helper/SymLinkHelper.cs | 76 +++++++++++++++++
.../Class/Helper/SystemInfoHelper.cs | 14 ++++
ProjBobcat/ProjBobcat/ProjBobcat.csproj | 3 +-
4 files changed, 174 insertions(+), 2 deletions(-)
create mode 100644 ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
create mode 100644 ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
new file mode 100644
index 00000000..eb4e6574
--- /dev/null
+++ b/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
@@ -0,0 +1,83 @@
+using System;
+using System.Diagnostics;
+
+namespace ProjBobcat.Class.Helper
+{
+ public static class CommandLineHelper
+ {
+ public static string RunCMD(string Head, string Flags)
+ {
+ try
+ {
+ ProcessStartInfo i = new()
+ {
+ FileName = Head,
+ Arguments = Flags,
+ RedirectStandardOutput = true,
+ CreateNoWindow = true,
+ };
+ using (var proc = Process.Start(i))
+ {
+ return proc.StandardOutput.ReadToEnd();
+ }
+
+ }catch(Exception ex)
+ {
+ return ex.ToString();
+ }
+ return "null";
+ }
+ //
+ public static string RunBash(string Command)
+ {
+ ///供Linux和macOS使用的Bash(macOS默认使用zsh)
+ ///
+#if OSX || LINUX
+
+ try
+ {
+ string FixedCommand = Command.Replace("\"", "\\\"");
+ Process proc = new()
+ {
+ StartInfo = new ProcessStartInfo
+ {
+#if OSX
+ FileName = "/bin/zsh",
+#elif LINUX
+ FileName = "/bin/bash",
+#endif
+ Arguments = $"-c \"{FixedCommand}\"",
+ RedirectStandardOutput = true,
+ UseShellExecute = false,
+ CreateNoWindow = true,
+
+ }
+ };
+ proc.Start();
+ string returning = proc.StandardOutput.ReadToEnd();
+ proc.WaitForExit();
+ proc.Dispose();
+ return returning;
+ }
+ catch (Exception ex)
+ {
+ return ex.ToString();
+ }
+#endif
+ return "null";
+ }
+ //
+ public static string RunBashArgs(string CommandHead, string[] Args)
+ {
+ string Arg = "";
+ foreach(var arg in Args)
+ {
+ Arg += (" " + arg);
+ }
+ return RunBash(CommandHead + Arg);
+
+ }
+
+ }
+}
+
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
new file mode 100644
index 00000000..7e04f41d
--- /dev/null
+++ b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
@@ -0,0 +1,76 @@
+using System;
+namespace ProjBobcat.Class.Helper
+{
+ public class SymLinkHelper
+ {
+ ///
+ /// 符号链接创建工具
+ ///
+
+ private string _defaultPublicResourceLocation;
+
+ public bool CreateLink(string TargetItem, string? OverrideDefaultLocation = null, bool? ParseToWindowsPath = null)
+ {
+ ///
+ /// 自动根据当前系统(构建) 选择 符号链接 创建方法.
+ ///
+ ///
+ /// 需要创建链接到具体版本的资源文件夹的单个文件之路径.(需要包含文件名与后缀)
+ ///
+ ///
+ /// 链接需要被创建到的路径(需要包含文件名与后缀), 可为null
+ ///
+ ///
+ /// 可null的值. 为true时将把两个路径中的/转换为\
+ ///
+ /// 返回成功与否.
+
+ string ThisDefaultLocation;
+
+ if (OverrideDefaultLocation is not null) ThisDefaultLocation = OverrideDefaultLocation;
+ else ThisDefaultLocation = _defaultPublicResourceLocation;
+
+ if(ParseToWindowsPath is not null) if ((bool)ParseToWindowsPath)
+ {
+ ThisDefaultLocation = ThisDefaultLocation.Replace("/", "\\");
+ TargetItem = TargetItem.Replace("/", "\\");
+ }
+ try {
+ string? CmdReturn = "";
+#if WINDOWS
+ // 原来从vista就自带mklink了哇 那就不考虑junction工具了.
+ CmdReturn = CommandLineHelper.RunCMD("mklink", $"/h {TargetItem} {ThisDefaultLocation}");
+ //? 待验证: /d与/h是否: 跨分区, 增加占用, 可被Minecraft识别
+#elif OSX
+ CmdReturn = CommandLineHelper.RunBash($"ln -s {TargetItem} {ThisDefaultLocation}");
+ // 一般而言, mac与linux用户可以不考虑跨分区问题. 可以在确认软链接可以被minecraft识别后直接全部软链接
+#elif LINUX
+ CmdReturn = CommandLineHelper.RunBash($"ln -s {TargetItem} {ThisDefaultLocation}");
+ // 这应该||就好了吧……不确定
+#endif
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.ToString());
+ return false;
+ }
+
+
+ return true;
+ }
+
+ public SymLinkHelper(string DefaultLocation)
+ {
+ ///
+ /// 构造方法
+ ///
+ ///
+ /// 创建对象时候存入默认的存储共享资源的路径.
+ ///
+ ///
+ _defaultPublicResourceLocation = DefaultLocation;
+
+ }
+ }
+}
+
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/SystemInfoHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/SystemInfoHelper.cs
index b03ef939..45ceeca4 100644
--- a/ProjBobcat/ProjBobcat/Class/Helper/SystemInfoHelper.cs
+++ b/ProjBobcat/ProjBobcat/Class/Helper/SystemInfoHelper.cs
@@ -88,4 +88,18 @@ static string FindJavaUsingEnvironmentVariable()
return string.Empty;
}
}
+
+ static string GetOsVersion()
+ {
+ string OsVersion = "null";
+#if WINDOWS
+ SystemInfo.WindowsSystemVersion vw = new();
+ OsVersion = vw.ToString();
+#elif OSX
+
+#elif LINUX
+
+#endif
+ return OsVersion;
+ }
}
\ No newline at end of file
diff --git a/ProjBobcat/ProjBobcat/ProjBobcat.csproj b/ProjBobcat/ProjBobcat/ProjBobcat.csproj
index cb693473..7200feaa 100644
--- a/ProjBobcat/ProjBobcat/ProjBobcat.csproj
+++ b/ProjBobcat/ProjBobcat/ProjBobcat.csproj
@@ -95,8 +95,7 @@ performance optimization
all
-
- 0.33.0
+
From 33e09317cf9dc186a9228b7d9cd5eaf3811d2a16 Mon Sep 17 00:00:00 2001
From: Feiron <53085628+fr1g@users.noreply.github.com>
Date: Fri, 24 Mar 2023 01:02:49 +0800
Subject: [PATCH 2/6] backup
---
.../ProjBobcat/Class/Helper/SymLinkHelper.cs | 39 +++++++++++++++++--
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
index 7e04f41d..434bfba7 100644
--- a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
+++ b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
@@ -18,7 +18,7 @@ public bool CreateLink(string TargetItem, string? OverrideDefaultLocation = null
/// 需要创建链接到具体版本的资源文件夹的单个文件之路径.(需要包含文件名与后缀)
///
///
- /// 链接需要被创建到的路径(需要包含文件名与后缀), 可为null
+ /// 链接需要被创建到的路径(需要包含文件名与后缀), 可为null, 默认值在创建对象时候创建(强烈建议传一个具体的)
///
///
/// 可null的值. 为true时将把两个路径中的/转换为\
@@ -29,17 +29,19 @@ public bool CreateLink(string TargetItem, string? OverrideDefaultLocation = null
if (OverrideDefaultLocation is not null) ThisDefaultLocation = OverrideDefaultLocation;
else ThisDefaultLocation = _defaultPublicResourceLocation;
+ // 未验证: 是否可以在不给文件后缀的情况下创建到此目录的默认同名文件... 若不能, 将在后续添加文件名检测和自动拼接.
if(ParseToWindowsPath is not null) if ((bool)ParseToWindowsPath)
{
ThisDefaultLocation = ThisDefaultLocation.Replace("/", "\\");
TargetItem = TargetItem.Replace("/", "\\");
}
- try {
- string? CmdReturn = "";
+ string? CmdReturn = "";
+ try {
+
#if WINDOWS
// 原来从vista就自带mklink了哇 那就不考虑junction工具了.
- CmdReturn = CommandLineHelper.RunCMD("mklink", $"/h {TargetItem} {ThisDefaultLocation}");
+ CmdReturn = CommandLineHelper.RunCMD("mklink", $"/d {TargetItem} {ThisDefaultLocation}");
//? 待验证: /d与/h是否: 跨分区, 增加占用, 可被Minecraft识别
#elif OSX
CmdReturn = CommandLineHelper.RunBash($"ln -s {TargetItem} {ThisDefaultLocation}");
@@ -55,7 +57,36 @@ public bool CreateLink(string TargetItem, string? OverrideDefaultLocation = null
return false;
}
+ if (CmdReturn.Contains("nvalid")) return false; // 收集可能的错误信息. 但是返回信息可能是不同的语言, 考虑移除...
+ return true;
+ }
+
+ public bool RemoveLink(string TargetLink)
+ {
+ string? CmdReturn = "";
+
+ try
+ {
+
+#if WINDOWS
+ // 原来从vista就自带mklink了哇 那就不考虑junction工具了.
+ CmdReturn = CommandLineHelper.RunCMD("erase", $"/Q {TargetLink}");
+ //? 待验证: /d与/h是否: 跨分区, 增加占用, 可被Minecraft识别
+#elif OSX
+ CmdReturn = CommandLineHelper.RunBash($"rm -rf {TargetLink}");
+ // 一般而言, mac与linux用户可以不考虑跨分区问题. 可以在确认软链接可以被minecraft识别后直接全部软链接
+#elif LINUX
+ CmdReturn = CommandLineHelper.RunBash($"unlink {TargetLink}");
+ // 这应该||就好了吧……不确定
+#endif
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex.ToString());
+ return false;
+ }
+ if (CmdReturn.Contains("nvalid")) return false; // 同上...
return true;
}
From 4d84ad93fd885f73250decce2a70c52b6e4b2a3e Mon Sep 17 00:00:00 2001
From: Feiron <53085628+fr1g@users.noreply.github.com>
Date: Fri, 24 Mar 2023 15:03:48 +0800
Subject: [PATCH 3/6] Fixed Arguments' Name Format
Caps letters to lower cased (first character)
---
.../Class/Helper/CommandLineHelper.cs | 18 +++++-----
.../ProjBobcat/Class/Helper/SymLinkHelper.cs | 36 +++++++++----------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
index eb4e6574..634f9b48 100644
--- a/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
+++ b/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
@@ -5,14 +5,14 @@ namespace ProjBobcat.Class.Helper
{
public static class CommandLineHelper
{
- public static string RunCMD(string Head, string Flags)
+ public static string RunCMD(string head, string flags)
{
try
{
ProcessStartInfo i = new()
{
- FileName = Head,
- Arguments = Flags,
+ FileName = head,
+ Arguments = flags,
RedirectStandardOutput = true,
CreateNoWindow = true,
};
@@ -28,7 +28,7 @@ public static string RunCMD(string Head, string Flags)
return "null";
}
//
- public static string RunBash(string Command)
+ public static string RunBash(string command)
{
///供Linux和macOS使用的Bash(macOS默认使用zsh)
///
@@ -36,7 +36,7 @@ public static string RunBash(string Command)
try
{
- string FixedCommand = Command.Replace("\"", "\\\"");
+ command = command.Replace("\"", "\\\"");
Process proc = new()
{
StartInfo = new ProcessStartInfo
@@ -46,7 +46,7 @@ public static string RunBash(string Command)
#elif LINUX
FileName = "/bin/bash",
#endif
- Arguments = $"-c \"{FixedCommand}\"",
+ Arguments = $"-c \"{command}\"",
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
@@ -67,14 +67,14 @@ public static string RunBash(string Command)
return "null";
}
//
- public static string RunBashArgs(string CommandHead, string[] Args)
+ public static string RunBashArgs(string commandHead, string[] args)
{
string Arg = "";
- foreach(var arg in Args)
+ foreach(var arg in args)
{
Arg += (" " + arg);
}
- return RunBash(CommandHead + Arg);
+ return RunBash(commandHead + Arg);
}
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
index 434bfba7..f490a4a2 100644
--- a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
+++ b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
@@ -9,45 +9,45 @@ public class SymLinkHelper
private string _defaultPublicResourceLocation;
- public bool CreateLink(string TargetItem, string? OverrideDefaultLocation = null, bool? ParseToWindowsPath = null)
+ public bool CreateLink(string targetItem, string? overrideDefaultLocation = null, bool? parseToWindowsPath = null)
{
///
/// 自动根据当前系统(构建) 选择 符号链接 创建方法.
///
- ///
+ ///
/// 需要创建链接到具体版本的资源文件夹的单个文件之路径.(需要包含文件名与后缀)
///
- ///
+ ///
/// 链接需要被创建到的路径(需要包含文件名与后缀), 可为null, 默认值在创建对象时候创建(强烈建议传一个具体的)
///
- ///
+ ///
/// 可null的值. 为true时将把两个路径中的/转换为\
///
/// 返回成功与否.
string ThisDefaultLocation;
- if (OverrideDefaultLocation is not null) ThisDefaultLocation = OverrideDefaultLocation;
+ if (overrideDefaultLocation is not null) ThisDefaultLocation = overrideDefaultLocation;
else ThisDefaultLocation = _defaultPublicResourceLocation;
// 未验证: 是否可以在不给文件后缀的情况下创建到此目录的默认同名文件... 若不能, 将在后续添加文件名检测和自动拼接.
- if(ParseToWindowsPath is not null) if ((bool)ParseToWindowsPath)
+ if(parseToWindowsPath is not null) if ((bool)parseToWindowsPath)
{
ThisDefaultLocation = ThisDefaultLocation.Replace("/", "\\");
- TargetItem = TargetItem.Replace("/", "\\");
+ targetItem = targetItem.Replace("/", "\\");
}
string? CmdReturn = "";
try {
#if WINDOWS
// 原来从vista就自带mklink了哇 那就不考虑junction工具了.
- CmdReturn = CommandLineHelper.RunCMD("mklink", $"/d {TargetItem} {ThisDefaultLocation}");
+ CmdReturn = CommandLineHelper.RunCMD("mklink", $"/d {targetItem} {ThisDefaultLocation}");
//? 待验证: /d与/h是否: 跨分区, 增加占用, 可被Minecraft识别
#elif OSX
- CmdReturn = CommandLineHelper.RunBash($"ln -s {TargetItem} {ThisDefaultLocation}");
+ CmdReturn = CommandLineHelper.RunBash($"ln -s {targetItem} {ThisDefaultLocation}");
// 一般而言, mac与linux用户可以不考虑跨分区问题. 可以在确认软链接可以被minecraft识别后直接全部软链接
#elif LINUX
- CmdReturn = CommandLineHelper.RunBash($"ln -s {TargetItem} {ThisDefaultLocation}");
+ CmdReturn = CommandLineHelper.RunBash($"ln -s {targetItem} {ThisDefaultLocation}");
// 这应该||就好了吧……不确定
#endif
}
@@ -62,7 +62,7 @@ public bool CreateLink(string TargetItem, string? OverrideDefaultLocation = null
return true;
}
- public bool RemoveLink(string TargetLink)
+ public bool RemoveLink(string targetLink)
{
string? CmdReturn = "";
@@ -71,13 +71,13 @@ public bool RemoveLink(string TargetLink)
#if WINDOWS
// 原来从vista就自带mklink了哇 那就不考虑junction工具了.
- CmdReturn = CommandLineHelper.RunCMD("erase", $"/Q {TargetLink}");
+ CmdReturn = CommandLineHelper.RunCMD("erase", $"/Q {targetLink}");
//? 待验证: /d与/h是否: 跨分区, 增加占用, 可被Minecraft识别
#elif OSX
- CmdReturn = CommandLineHelper.RunBash($"rm -rf {TargetLink}");
+ CmdReturn = CommandLineHelper.RunBash($"rm -rf {targetLink}");
// 一般而言, mac与linux用户可以不考虑跨分区问题. 可以在确认软链接可以被minecraft识别后直接全部软链接
#elif LINUX
- CmdReturn = CommandLineHelper.RunBash($"unlink {TargetLink}");
+ CmdReturn = CommandLineHelper.RunBash($"unlink {targetLink}");
// 这应该||就好了吧……不确定
#endif
}
@@ -90,16 +90,16 @@ public bool RemoveLink(string TargetLink)
return true;
}
- public SymLinkHelper(string DefaultLocation)
+ public SymLinkHelper(string defaultLocation)
{
///
/// 构造方法
///
- ///
- /// 创建对象时候存入默认的存储共享资源的路径.
+ ///
+ /// 创建对象时候存入默认的存储共享资源(软链创建点)的路径.
///
///
- _defaultPublicResourceLocation = DefaultLocation;
+ _defaultPublicResourceLocation = defaultLocation;
}
}
From 43644a6be7914e02245abcbe9b97cc693d07a4bf Mon Sep 17 00:00:00 2001
From: Feiron <53085628+fr1g@users.noreply.github.com>
Date: Fri, 24 Mar 2023 15:13:37 +0800
Subject: [PATCH 4/6] Fixing Error during code check
---
.../ProjBobcat/Class/Helper/CommandLineHelper.cs | 9 +++------
.../ProjBobcat/Class/Helper/SymLinkHelper.cs | 14 ++------------
2 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
index 634f9b48..1280d2b1 100644
--- a/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
+++ b/ProjBobcat/ProjBobcat/Class/Helper/CommandLineHelper.cs
@@ -20,8 +20,8 @@ public static string RunCMD(string head, string flags)
{
return proc.StandardOutput.ReadToEnd();
}
-
- }catch(Exception ex)
+ }
+ catch(Exception ex)
{
return ex.ToString();
}
@@ -75,9 +75,6 @@ public static string RunBashArgs(string commandHead, string[] args)
Arg += (" " + arg);
}
return RunBash(commandHead + Arg);
-
}
-
}
-}
-
+}
\ No newline at end of file
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
index f490a4a2..a32fa31f 100644
--- a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
+++ b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
@@ -6,7 +6,6 @@ public class SymLinkHelper
///
/// 符号链接创建工具
///
-
private string _defaultPublicResourceLocation;
public bool CreateLink(string targetItem, string? overrideDefaultLocation = null, bool? parseToWindowsPath = null)
@@ -38,9 +37,8 @@ public bool CreateLink(string targetItem, string? overrideDefaultLocation = null
}
string? CmdReturn = "";
try {
-
#if WINDOWS
- // 原来从vista就自带mklink了哇 那就不考虑junction工具了.
+ // 原来从vista就自带mklink了哇 那就不考虑junction工具了.
CmdReturn = CommandLineHelper.RunCMD("mklink", $"/d {targetItem} {ThisDefaultLocation}");
//? 待验证: /d与/h是否: 跨分区, 增加占用, 可被Minecraft识别
#elif OSX
@@ -58,8 +56,7 @@ public bool CreateLink(string targetItem, string? overrideDefaultLocation = null
}
if (CmdReturn.Contains("nvalid")) return false; // 收集可能的错误信息. 但是返回信息可能是不同的语言, 考虑移除...
-
- return true;
+ else return true;
}
public bool RemoveLink(string targetLink)
@@ -68,17 +65,12 @@ public bool RemoveLink(string targetLink)
try
{
-
#if WINDOWS
- // 原来从vista就自带mklink了哇 那就不考虑junction工具了.
CmdReturn = CommandLineHelper.RunCMD("erase", $"/Q {targetLink}");
- //? 待验证: /d与/h是否: 跨分区, 增加占用, 可被Minecraft识别
#elif OSX
CmdReturn = CommandLineHelper.RunBash($"rm -rf {targetLink}");
- // 一般而言, mac与linux用户可以不考虑跨分区问题. 可以在确认软链接可以被minecraft识别后直接全部软链接
#elif LINUX
CmdReturn = CommandLineHelper.RunBash($"unlink {targetLink}");
- // 这应该||就好了吧……不确定
#endif
}
catch (Exception ex)
@@ -98,9 +90,7 @@ public SymLinkHelper(string defaultLocation)
///
/// 创建对象时候存入默认的存储共享资源(软链创建点)的路径.
///
- ///
_defaultPublicResourceLocation = defaultLocation;
-
}
}
}
From b5a504e5968874b26df119f792245c3f923ba569 Mon Sep 17 00:00:00 2001
From: Feiron <53085628+fr1g@users.noreply.github.com>
Date: Fri, 24 Mar 2023 15:19:53 +0800
Subject: [PATCH 5/6] continue fixing...
---
ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
index a32fa31f..05cb4eb9 100644
--- a/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
+++ b/ProjBobcat/ProjBobcat/Class/Helper/SymLinkHelper.cs
@@ -62,13 +62,12 @@ public bool CreateLink(string targetItem, string? overrideDefaultLocation = null
public bool RemoveLink(string targetLink)
{
string? CmdReturn = "";
-
try
{
#if WINDOWS
CmdReturn = CommandLineHelper.RunCMD("erase", $"/Q {targetLink}");
#elif OSX
- CmdReturn = CommandLineHelper.RunBash($"rm -rf {targetLink}");
+ CmdReturn = CommandLineHelper.RunBash($"rm -rf {targetLink}");
#elif LINUX
CmdReturn = CommandLineHelper.RunBash($"unlink {targetLink}");
#endif
@@ -93,5 +92,4 @@ public SymLinkHelper(string defaultLocation)
_defaultPublicResourceLocation = defaultLocation;
}
}
-}
-
+}
\ No newline at end of file
From 978a49e9b8f9d8dbc5812ba6d51fa5e1fdd208e8 Mon Sep 17 00:00:00 2001
From: Feiron <53085628+fr1g@users.noreply.github.com>
Date: Sat, 29 Jul 2023 19:00:29 +0800
Subject: [PATCH 6/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=BA=86=E8=B7=AF?=
=?UTF-8?q?=E5=8A=B2=E7=89=8C=E6=9C=BA=E6=B2=B9=E7=9A=84=E6=A4=8D=E5=85=A5?=
=?UTF-8?q?=E5=B9=BF=E5=91=8A=EF=BC=88=E8=BF=AB=E7=9C=9F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
其实就是有笨蛋打错了字
---
.../DefaultComponent/Launch/GameCore/DefaultGameCore.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ProjBobcat/ProjBobcat/DefaultComponent/Launch/GameCore/DefaultGameCore.cs b/ProjBobcat/ProjBobcat/DefaultComponent/Launch/GameCore/DefaultGameCore.cs
index 57626b89..8a7c224e 100644
--- a/ProjBobcat/ProjBobcat/DefaultComponent/Launch/GameCore/DefaultGameCore.cs
+++ b/ProjBobcat/ProjBobcat/DefaultComponent/Launch/GameCore/DefaultGameCore.cs
@@ -158,7 +158,7 @@ public override async Task LaunchTaskAsync(LaunchSettings? setting
{
Cause = "未找到JRE运行时,可能是输入的路劲为空或出错,亦或是指定的文件并不存在。",
Error = "未找到JRE运行时",
- ErrorMessage = "输入的路劲为空或出错,亦或是指定的文件并不存在"
+ ErrorMessage = "输入的路径为空或出错,亦或是指定的文件并不存在"
}
};
@@ -409,4 +409,4 @@ void InvokeLaunchLogThenStart(string item, ref TimeSpan time, ref Stopwatch sw)
}
#endregion
-}
\ No newline at end of file
+}