Skip to content

Commit

Permalink
Rename old uppercase datafolder to lowercase if it existed
Browse files Browse the repository at this point in the history
This should do nothing on file systems which ignore the case
  • Loading branch information
Phoenix616 committed Mar 21, 2024
1 parent 86eea54 commit 352dd29
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/net/azisaba/kuvel/config/KuvelConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ public class KuvelConfig {
@Nullable private String proxyGroupName;

public void load() throws IOException {
File uppercaseDataFolder = new File(plugin.getDataDirectory().getParentFile(), "Kuvel");
if (uppercaseDataFolder.exists() && !plugin.getDataDirectory().exists()) {
if (uppercaseDataFolder.renameTo(plugin.getDataDirectory())) {
plugin
.getLogger()
.info(
"Successfully renamed the data folder to use a lowercase name.");
} else {
plugin
.getLogger()
.warn(
"Failed to rename the data folder to be lowercase. Please manually rename the data folder to 'kuvel'.");
}
}

VelocityConfigLoader conf = VelocityConfigLoader.load(new File(plugin.getDataDirectory(), CONFIG_FILE_NAME));
conf.saveDefaultConfig();

Expand Down

0 comments on commit 352dd29

Please sign in to comment.