diff --git a/LiuDanK.SageTools.sln b/LiuDanK.SageTools.sln index c098fae..a77586b 100644 --- a/LiuDanK.SageTools.sln +++ b/LiuDanK.SageTools.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 17.0.31717.71 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SageTools", "SageTools\SageTools.csproj", "{E8C38E65-0000-4229-BC12-32A4D35BF2DA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SageTools.Console", "SageTools.Console\SageTools.Console.csproj", "{BCD16F41-A924-49F5-A161-015CFC40FF02}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -17,10 +15,6 @@ Global {E8C38E65-0000-4229-BC12-32A4D35BF2DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {E8C38E65-0000-4229-BC12-32A4D35BF2DA}.Release|Any CPU.ActiveCfg = Release|Any CPU {E8C38E65-0000-4229-BC12-32A4D35BF2DA}.Release|Any CPU.Build.0 = Release|Any CPU - {BCD16F41-A924-49F5-A161-015CFC40FF02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BCD16F41-A924-49F5-A161-015CFC40FF02}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BCD16F41-A924-49F5-A161-015CFC40FF02}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BCD16F41-A924-49F5-A161-015CFC40FF02}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SageTools.Console/Extension.cs b/SageTools.Console/Extension.cs deleted file mode 100644 index 4559b69..0000000 --- a/SageTools.Console/Extension.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Linq; -using SageTools.Extension; - -namespace SageTools.Console; - -public static class Extension -{ - public static string GetArgValue(this string[] args, string argKey) - { - if (args.IsNullOrEmpty() || argKey.IsNullOrWhiteSpace()) return default; - argKey = '-' + argKey.TrimStart('-').TrimEnd('=') + '='; - return args.Where(x => x.Contains(argKey)).Select(x => x.Replace(argKey, "")).FirstOrDefault(); - } -} \ No newline at end of file diff --git a/SageTools.Console/Program.cs b/SageTools.Console/Program.cs deleted file mode 100644 index f5570b5..0000000 --- a/SageTools.Console/Program.cs +++ /dev/null @@ -1,85 +0,0 @@ -using SageTools.Extension; -using System; -using System.Linq; -using System.Xml; - -namespace SageTools.Console -{ - internal class Program - { - private static void Main(string[] args) - { - if (args.Any(x => x.Contains("-h"))) - { - ShowHelp(); - Environment.Exit(0); - } - - System.Console.WriteLine("**************开始处理**************"); - - var source = args.GetArgValue("s"); - var version = args.GetArgValue("v"); - var description = args.GetArgValue("d"); - var copyright = args.GetArgValue("r"); - - UpdateXmlValues(source, description, copyright, version); - - System.Console.WriteLine("**************处理完毕**************"); - } - - private static void ShowHelp() - { - System.Console.WriteLine(); - System.Console.WriteLine("使用帮助:"); - System.Console.WriteLine("-h 查看帮助"); - System.Console.WriteLine("-s 项目.csproj文件路径"); - System.Console.WriteLine("-v 指定的版本"); - System.Console.WriteLine("-d 描述"); - System.Console.WriteLine("-r 版权描述"); - System.Console.WriteLine(); - } - - private static void UpdateXmlValues(string xmlFilePath, string newDescription, string newCopyright, string newVersion) - { - var xmlDoc = new XmlDocument(); - xmlDoc.Load(xmlFilePath); - - #region description - - var descriptionNode = xmlDoc.SelectSingleNode("//Description"); - if (descriptionNode != null && newDescription.IsNotNullOrWhiteSpace()) - { - descriptionNode.InnerText = newDescription; - } - - #endregion description - - #region copyright - - var copyrightNode = xmlDoc.SelectSingleNode("//Copyright"); - if (copyrightNode != null && newCopyright.IsNotNullOrWhiteSpace()) - { - copyrightNode.InnerText = newCopyright; - } - - #endregion copyright - - #region version - - var versionNode = xmlDoc.SelectSingleNode("//Version"); - if (versionNode != null && newVersion.IsNotNullOrWhiteSpace()) - { - versionNode.InnerText = newVersion; - } - - #endregion version - - xmlDoc.Save(xmlFilePath); - System.Console.WriteLine("**************处理结果**************"); - System.Console.WriteLine($"文件路径:{xmlFilePath}"); - System.Console.WriteLine($"版本:{versionNode?.InnerText}"); - System.Console.WriteLine($"描述:{descriptionNode?.InnerText}"); - System.Console.WriteLine($"版权:{copyrightNode?.InnerText}"); - } - } -} \ No newline at end of file diff --git a/SageTools.Console/Properties/launchSettings.json b/SageTools.Console/Properties/launchSettings.json deleted file mode 100644 index e9aba79..0000000 --- a/SageTools.Console/Properties/launchSettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "profiles": { - "SageTools.Console": { - "commandName": "Project" - } - } -} \ No newline at end of file diff --git a/SageTools.Console/SageTools.Console.csproj b/SageTools.Console/SageTools.Console.csproj deleted file mode 100644 index 1d67515..0000000 --- a/SageTools.Console/SageTools.Console.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - net6.0 - - - - - - - diff --git "a/\345\217\221\345\270\203/nuget.exe" "b/\345\217\221\345\270\203/nuget.exe" deleted file mode 100644 index 8f393dd..0000000 Binary files "a/\345\217\221\345\270\203/nuget.exe" and /dev/null differ diff --git "a/\345\217\221\345\270\203/\345\217\221\345\270\203\345\221\275\344\273\244.txt" "b/\345\217\221\345\270\203/\345\217\221\345\270\203\345\221\275\344\273\244.txt" deleted file mode 100644 index ca3c30f..0000000 --- "a/\345\217\221\345\270\203/\345\217\221\345\270\203\345\221\275\344\273\244.txt" +++ /dev/null @@ -1,3 +0,0 @@ -./nuget.exe push SageTools.0.0.4.nupkg ApiKey -Source https://api.nuget.org/v3/index.json - -dotnet nuget push SageTools.0.0.4.nupkg ApiKey -s https://api.nuget.org/v3/index.json \ No newline at end of file