Removed Windows support.
This commit is contained in:
parent
b793af9157
commit
b6656506ee
2 changed files with 2 additions and 10 deletions
|
@ -2,7 +2,6 @@
|
||||||
public class Config {
|
public class Config {
|
||||||
public string FileSystemPathV2 { get; set; }
|
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 MySqlDumpPath { get; set; } = @"mysqldump";
|
||||||
public string MySqlHost { get; set; } = @"localhost";
|
public string MySqlHost { get; set; } = @"localhost";
|
||||||
public string MySqlUser { get; set; }
|
public string MySqlUser { get; set; }
|
||||||
|
|
|
@ -17,9 +17,6 @@ namespace BackupManager
|
||||||
|
|
||||||
private const string CONFIG_NAME = @"FlashiiBackupManager.v1.xml";
|
private const string CONFIG_NAME = @"FlashiiBackupManager.v1.xml";
|
||||||
|
|
||||||
public static bool IsWindows
|
|
||||||
=> RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
|
||||||
|
|
||||||
public readonly static DateTimeOffset Startup = DateTimeOffset.UtcNow;
|
public readonly static DateTimeOffset Startup = DateTimeOffset.UtcNow;
|
||||||
|
|
||||||
public static string Basename
|
public static string Basename
|
||||||
|
@ -39,10 +36,6 @@ namespace BackupManager
|
||||||
|
|
||||||
private static bool Headless;
|
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) {
|
public static Stream ToXml(this object obj, bool pretty = false) {
|
||||||
MemoryStream ms = new();
|
MemoryStream ms = new();
|
||||||
XmlSerializer xs = new(obj.GetType());
|
XmlSerializer xs = new(obj.GetType());
|
||||||
|
@ -215,7 +208,7 @@ namespace BackupManager
|
||||||
foreach(string file in storeFiles)
|
foreach(string file in storeFiles)
|
||||||
archive.CreateEntryFromFile(
|
archive.CreateEntryFromFile(
|
||||||
file,
|
file,
|
||||||
@"misuzu/store/" + file.Replace(storePath, string.Empty).WindowsToUnixPath().Trim('/'),
|
@"misuzu/store/" + file.Replace(storePath, string.Empty).Trim('/'),
|
||||||
CompressionLevel.Optimal
|
CompressionLevel.Optimal
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +234,7 @@ namespace BackupManager
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Process p = Process.Start(new ProcessStartInfo {
|
Process p = Process.Start(new ProcessStartInfo {
|
||||||
FileName = IsWindows ? Config.MySqlDumpPathWindows : Config.MySqlDumpPath,
|
FileName = Config.MySqlDumpPath,
|
||||||
Arguments = mysqldumpArgs.ToString(),
|
Arguments = mysqldumpArgs.ToString(),
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
CreateNoWindow = true,
|
CreateNoWindow = true,
|
||||||
|
|
Reference in a new issue