diff --git a/cli/.vs/MythicalDash/DesignTimeBuild/.dtbcache.v2 b/cli/.vs/MythicalDash/DesignTimeBuild/.dtbcache.v2 new file mode 100644 index 0000000..c32f56d Binary files /dev/null and b/cli/.vs/MythicalDash/DesignTimeBuild/.dtbcache.v2 differ diff --git a/cli/.vs/MythicalDash/FileContentIndex/15ef9014-f2d8-4b35-a7b4-45123e120f73.vsidx b/cli/.vs/MythicalDash/FileContentIndex/15ef9014-f2d8-4b35-a7b4-45123e120f73.vsidx new file mode 100644 index 0000000..9899dbb Binary files /dev/null and b/cli/.vs/MythicalDash/FileContentIndex/15ef9014-f2d8-4b35-a7b4-45123e120f73.vsidx differ diff --git a/cli/.vs/MythicalDash/FileContentIndex/568a33fd-eba0-4f26-9b62-47a7c327eb1a.vsidx b/cli/.vs/MythicalDash/FileContentIndex/568a33fd-eba0-4f26-9b62-47a7c327eb1a.vsidx new file mode 100644 index 0000000..1fc3945 Binary files /dev/null and b/cli/.vs/MythicalDash/FileContentIndex/568a33fd-eba0-4f26-9b62-47a7c327eb1a.vsidx differ diff --git a/cli/.vs/MythicalDash/FileContentIndex/63a645b0-bd48-40cb-b702-4e466fd46231.vsidx b/cli/.vs/MythicalDash/FileContentIndex/63a645b0-bd48-40cb-b702-4e466fd46231.vsidx new file mode 100644 index 0000000..232dfad Binary files /dev/null and b/cli/.vs/MythicalDash/FileContentIndex/63a645b0-bd48-40cb-b702-4e466fd46231.vsidx differ diff --git a/cli/.vs/MythicalDash/FileContentIndex/e27114bf-581e-4031-8f23-3fbba4827e05.vsidx b/cli/.vs/MythicalDash/FileContentIndex/e27114bf-581e-4031-8f23-3fbba4827e05.vsidx new file mode 100644 index 0000000..616d257 Binary files /dev/null and b/cli/.vs/MythicalDash/FileContentIndex/e27114bf-581e-4031-8f23-3fbba4827e05.vsidx differ diff --git a/cli/.vs/MythicalDash/FileContentIndex/read.lock b/cli/.vs/MythicalDash/FileContentIndex/read.lock new file mode 100644 index 0000000..e69de29 diff --git a/cli/.vs/MythicalDash/v17/.suo b/cli/.vs/MythicalDash/v17/.suo new file mode 100644 index 0000000..e793b73 Binary files /dev/null and b/cli/.vs/MythicalDash/v17/.suo differ diff --git a/cli/FodyWeavers.xml b/cli/FodyWeavers.xml new file mode 100644 index 0000000..f1dea8f --- /dev/null +++ b/cli/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/cli/FodyWeavers.xsd b/cli/FodyWeavers.xsd new file mode 100644 index 0000000..ff119f7 --- /dev/null +++ b/cli/FodyWeavers.xsd @@ -0,0 +1,141 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Controls if runtime assemblies are also embedded. + + + + + Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/cli/Logger.cs b/cli/Logger.cs new file mode 100644 index 0000000..ba6a9fc --- /dev/null +++ b/cli/Logger.cs @@ -0,0 +1,94 @@ +namespace MythicalDash +{ + public enum LogType + { + Info, + Warning, + Error + } + + public class Logger + { + private string logFilePath; + + public Logger() + { + string logDirectory = "logs"; + string logFileName = "log.txt"; + string logDirectoryPath = Path.Combine(Directory.GetCurrentDirectory(), logDirectory); + logFilePath = Path.Combine(logDirectoryPath, logFileName); + Directory.CreateDirectory(logDirectoryPath); + RenameLogFile(); + } + + public void Log(LogType type, string message) + { + string timestamp = DateTime.Now.ToString("HH:mm:ss"); + string logText = $"[{timestamp}] [{type.ToString()}] {message}"; + + ConsoleColor color = ConsoleColor.White; + switch (type) + { + case LogType.Info: + color = ConsoleColor.Blue; + break; + case LogType.Warning: + color = ConsoleColor.Yellow; + break; + case LogType.Error: + color = ConsoleColor.Red; + break; + } + Console.ForegroundColor = color; + Console.WriteLine(logText); + Console.ResetColor(); + + AppendToFile(logText); + } + + private void AppendToFile(string logText) + { + try + { + using (StreamWriter writer = File.AppendText(logFilePath)) + { + writer.WriteLine(logText); + } + } + catch (Exception ex) + { + Console.WriteLine($"Error writing to log file: {ex.Message}"); + } + } + + private void RenameLogFile() + { + if (File.Exists(logFilePath)) + { + string logFileNameWithoutExtension = Path.GetFileNameWithoutExtension(logFilePath); + string logFileExtension = Path.GetExtension(logFilePath); +#pragma warning disable + string logDirectoryPath = Path.GetDirectoryName(logFilePath); + string newLogFileName = GetUniqueLogFileName(logDirectoryPath, logFileNameWithoutExtension, logFileExtension); +#pragma warning restore + string newLogFilePath = Path.Combine(logDirectoryPath, newLogFileName); + File.Move(logFilePath, newLogFilePath); + } + } + + private string GetUniqueLogFileName(string directoryPath, string fileNameWithoutExtension, string fileExtension) + { + string uniqueFileName = $"{fileNameWithoutExtension}-{DateTime.Now:yyyy-MM-dd}{fileExtension}"; + string uniqueFilePath = Path.Combine(directoryPath, uniqueFileName); + + int counter = 1; + while (File.Exists(uniqueFilePath)) + { + uniqueFileName = $"{fileNameWithoutExtension}-{counter++}-{DateTime.Now:yyyy-MM-dd}{fileExtension}"; + uniqueFilePath = Path.Combine(directoryPath, uniqueFileName); + } + + return uniqueFileName; + } + } +} \ No newline at end of file diff --git a/cli/MythicalDash.csproj b/cli/MythicalDash.csproj new file mode 100644 index 0000000..ae8c10e --- /dev/null +++ b/cli/MythicalDash.csproj @@ -0,0 +1,23 @@ + + + + Exe + net7.0 + enable + enable + logo.ico + False + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/cli/MythicalDash.sln b/cli/MythicalDash.sln new file mode 100644 index 0000000..2c47c91 --- /dev/null +++ b/cli/MythicalDash.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33815.320 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MythicalDash", "MythicalDash.csproj", "{92A04E13-F64C-4CEE-99DD-328A38609A90}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {92A04E13-F64C-4CEE-99DD-328A38609A90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {92A04E13-F64C-4CEE-99DD-328A38609A90}.Debug|Any CPU.Build.0 = Debug|Any CPU + {92A04E13-F64C-4CEE-99DD-328A38609A90}.Release|Any CPU.ActiveCfg = Release|Any CPU + {92A04E13-F64C-4CEE-99DD-328A38609A90}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {57EF9787-8693-492E-99E9-26F919158E9D} + EndGlobalSection +EndGlobal diff --git a/cli/Program.cs b/cli/Program.cs new file mode 100644 index 0000000..99f8710 --- /dev/null +++ b/cli/Program.cs @@ -0,0 +1,48 @@ +using System; + +namespace MythicalDash +{ + public class Program + { + public static string ascii = @" + __ __ _ _ _ _ _____ _ + | \/ | | | | | (_) | | __ \ | | + | \ / |_ _| |_| |__ _ ___ __ _| | | | | __ _ ___| |__ + | |\/| | | | | __| '_ \| |/ __/ _` | | | | |/ _` / __| '_ \ + | | | | |_| | |_| | | | | (_| (_| | | |__| | (_| \__ \ | | | + |_| |_|\__, |\__|_| |_|_|\___\__,_|_|_____/ \__,_|___/_| |_| + __/ | + |___/ +"; + public static string version = "1.0.0"; + public static bool skiposcheck = true; + public static Logger logger = new Logger(); + public static void Main(string[] args) + { + Console.Clear(); + Console.WriteLine(ascii); + if (skiposcheck == false) { + if (!System.OperatingSystem.IsLinux()) + { + logger.Log(LogType.Error, "Sorry but this app runs on linux!"); + Environment.Exit(0x0); + } + } + if (args.Contains("-version")) + { + logger.Log(LogType.Info, "You are running version: " + version); + Environment.Exit(0x0); + } + else if (args.Length > 0) + { + logger.Log(LogType.Error, "This is an invalid startup argument. Please use '-help' to get more information"); + Environment.Exit(0x0); + } else + { + logger.Log(LogType.Error, "This is an invalid startup argument. Please use '-help' to get more information"); + Environment.Exit(0x0); + } + } + } + +} \ No newline at end of file diff --git a/cli/logo.ico b/cli/logo.ico new file mode 100644 index 0000000..c17686a Binary files /dev/null and b/cli/logo.ico differ diff --git a/cli/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs b/cli/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs new file mode 100644 index 0000000..88ecc6e --- /dev/null +++ b/cli/obj/Debug/net7.0/.NETCoreApp,Version=v7.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v7.0", FrameworkDisplayName = "")] diff --git a/cli/obj/Debug/net7.0/MythicalDash.AssemblyInfo.cs b/cli/obj/Debug/net7.0/MythicalDash.AssemblyInfo.cs new file mode 100644 index 0000000..83736cd --- /dev/null +++ b/cli/obj/Debug/net7.0/MythicalDash.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("MythicalDash")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyProductAttribute("MythicalDash")] +[assembly: System.Reflection.AssemblyTitleAttribute("MythicalDash")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/cli/obj/Debug/net7.0/MythicalDash.AssemblyInfoInputs.cache b/cli/obj/Debug/net7.0/MythicalDash.AssemblyInfoInputs.cache new file mode 100644 index 0000000..9c7e5bb --- /dev/null +++ b/cli/obj/Debug/net7.0/MythicalDash.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +ff5325278ff6efc3cd9e5ee59b264a000d7532b9 diff --git a/cli/obj/Debug/net7.0/MythicalDash.GeneratedMSBuildEditorConfig.editorconfig b/cli/obj/Debug/net7.0/MythicalDash.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..b4a01cb --- /dev/null +++ b/cli/obj/Debug/net7.0/MythicalDash.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,10 @@ +is_global = true +build_property.TargetFramework = net7.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = MythicalDash +build_property.ProjectDir = /var/www/client/cli/ diff --git a/cli/obj/Debug/net7.0/MythicalDash.GlobalUsings.g.cs b/cli/obj/Debug/net7.0/MythicalDash.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/cli/obj/Debug/net7.0/MythicalDash.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks;