Removed if statement for deleting config file

This commit is contained in:
coolGi
2023-08-17 23:16:51 +09:30
parent e488cb8a4c
commit 4969d2362d
@@ -40,6 +40,10 @@ public class ConfigFileHandling
if (!Files.exists(configPath)) // Try to check if the config exists
try
{
if (!this.configPath.getParent().toFile().exists())
{
Files.createDirectory(this.configPath.getParent());
}
Files.createFile(configPath);
}
catch (IOException ex)
@@ -240,15 +244,14 @@ public class ConfigFileHandling
{
Files.createDirectory(this.configPath.getParent());
}
else
boolean fileDeleted = Files.deleteIfExists(this.configPath);
if (!fileDeleted)
{
boolean fileDeleted = Files.deleteIfExists(this.configPath);
if (!fileDeleted)
{
System.err.println("Unable to delete config at path: ["+this.configPath+"]");
}
System.err.println("Unable to delete config at path: [" + this.configPath + "]");
}
Files.createFile(this.configPath);
config.load();
}