Merge branch 'new-master' of git.flash.moe:flashii/sharp-chat into new-master

This commit is contained in:
flash 2023-11-04 23:37:13 +00:00
commit c46d117d15

View file

@ -124,12 +124,11 @@ namespace SharpChat {
const string mdb_config = @"mariadb.txt"; const string mdb_config = @"mariadb.txt";
bool hasMDB = File.Exists(mdb_config);
string[] mdbCfg = File.Exists(mdb_config) ? File.ReadAllLines(mdb_config) : Array.Empty<string>(); string[] mdbCfg = File.Exists(mdb_config) ? File.ReadAllLines(mdb_config) : Array.Empty<string>();
sw.WriteLine(); sw.WriteLine();
sw.WriteLine("# MariaDB configuration"); sw.WriteLine("# MariaDB configuration");
if(!string.IsNullOrWhiteSpace(mdbCfg[0])) if(mdbCfg.Length > 0)
sw.WriteLine($"mariadb:host {mdbCfg[0]}"); sw.WriteLine($"mariadb:host {mdbCfg[0]}");
else else
sw.WriteLine($"#mariadb:host <username>"); sw.WriteLine($"#mariadb:host <username>");