mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Update settings directory path in exceptions (#7968)
This commit is contained in:
parent
683149f9a1
commit
e827d176c4
1 changed files with 3 additions and 3 deletions
|
@ -1241,17 +1241,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ final String legacyFileName = legacyConfig.getFileName().toString();
|
||||
+ try {
|
||||
+ if (Files.exists(configDir) && !Files.isDirectory(configDir)) {
|
||||
+ throw new RuntimeException("Paper needs to create a '" + CONFIG_DIR + "' folder in the root of your server. You already have a non-directory named '" + CONFIG_DIR + "'. Please remove it and restart the server.");
|
||||
+ throw new RuntimeException("Paper needs to create a '" + configDir.toAbsolutePath() + "' folder. You already have a non-directory named '" + configDir.toAbsolutePath() + "'. Please remove it and restart the server.");
|
||||
+ }
|
||||
+ final Path backupDir = configDir.resolve(BACKUP_DIR);
|
||||
+ if (Files.exists(backupDir) && !Files.isDirectory(backupDir)) {
|
||||
+ throw new RuntimeException("Paper needs to create a '" + BACKUP_DIR + "' directory in the '" + CONFIG_DIR + "' folder. You already have a non-directory named '" + BACKUP_DIR + "'. Please remove it and restart the server.");
|
||||
+ throw new RuntimeException("Paper needs to create a '" + BACKUP_DIR + "' directory in the '" + configDir.toAbsolutePath() + "' folder. You already have a non-directory named '" + BACKUP_DIR + "'. Please remove it and restart the server.");
|
||||
+ }
|
||||
+ createDirectoriesSymlinkAware(backupDir);
|
||||
+ final String backupFileName = legacyFileName + ".old";
|
||||
+ final Path legacyConfigBackup = backupDir.resolve(backupFileName);
|
||||
+ if (Files.exists(legacyConfigBackup) && !Files.isRegularFile(legacyConfigBackup)) {
|
||||
+ throw new RuntimeException("Paper needs to create a '" + backupFileName + "' file in the '" + BACKUP_DIR + "' folder. You already have a non-file named '" + backupFileName + "'. Please remove it and restart the server.");
|
||||
+ throw new RuntimeException("Paper needs to create a '" + backupFileName + "' file in the '" + backupDir.toAbsolutePath() + "' folder. You already have a non-file named '" + backupFileName + "'. Please remove it and restart the server.");
|
||||
+ }
|
||||
+ Files.move(legacyConfig.toRealPath(), legacyConfigBackup, StandardCopyOption.REPLACE_EXISTING); // make backup
|
||||
+ if (Files.isSymbolicLink(legacyConfig)) {
|
||||
|
|
Loading…
Reference in a new issue