From b6656506eeb96f475016a167d1d0a9d2dbc481df Mon Sep 17 00:00:00 2001 From: flashwave Date: Mon, 4 Sep 2023 14:56:53 +0200 Subject: [PATCH] Removed Windows support. --- BackupManager/Config.cs | 1 - BackupManager/Program.cs | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/BackupManager/Config.cs b/BackupManager/Config.cs index 3012ae9..e7a5b08 100644 --- a/BackupManager/Config.cs +++ b/BackupManager/Config.cs @@ -2,7 +2,6 @@ public class Config { public string FileSystemPathV2 { get; set; } - public string MySqlDumpPathWindows { get; set; } = @"C:\Program Files\MariaDB 10.3\bin\mysqldump.exe"; public string MySqlDumpPath { get; set; } = @"mysqldump"; public string MySqlHost { get; set; } = @"localhost"; public string MySqlUser { get; set; } diff --git a/BackupManager/Program.cs b/BackupManager/Program.cs index b483936..0457b02 100644 --- a/BackupManager/Program.cs +++ b/BackupManager/Program.cs @@ -17,9 +17,6 @@ namespace BackupManager private const string CONFIG_NAME = @"FlashiiBackupManager.v1.xml"; - public static bool IsWindows - => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); - public readonly static DateTimeOffset Startup = DateTimeOffset.UtcNow; public static string Basename @@ -39,10 +36,6 @@ namespace BackupManager private static bool Headless; - public static string WindowsToUnixPath(this string path) { - return IsWindows ? path.Replace('\\', '/') : path; - } - public static Stream ToXml(this object obj, bool pretty = false) { MemoryStream ms = new(); XmlSerializer xs = new(obj.GetType()); @@ -215,7 +208,7 @@ namespace BackupManager foreach(string file in storeFiles) archive.CreateEntryFromFile( file, - @"misuzu/store/" + file.Replace(storePath, string.Empty).WindowsToUnixPath().Trim('/'), + @"misuzu/store/" + file.Replace(storePath, string.Empty).Trim('/'), CompressionLevel.Optimal ); } @@ -241,7 +234,7 @@ namespace BackupManager #endif Process p = Process.Start(new ProcessStartInfo { - FileName = IsWindows ? Config.MySqlDumpPathWindows : Config.MySqlDumpPath, + FileName = Config.MySqlDumpPath, Arguments = mysqldumpArgs.ToString(), UseShellExecute = false, CreateNoWindow = true,