mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-12-20 07:47:38 +01:00
Add README.txt in backups folder
This commit is contained in:
parent
72cdacb998
commit
5225d34cb6
@ -13,6 +13,7 @@ import me.filoghost.holographicdisplays.plugin.config.ConfigManager;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Collections;
|
||||
|
||||
public abstract class LegacyUpgrade implements LegacyUpgradeTask {
|
||||
|
||||
@ -63,6 +64,17 @@ public abstract class LegacyUpgrade implements LegacyUpgradeTask {
|
||||
errorCollector.add(e, "error while copying file \"" + configManager.formatPath(file) + "\""
|
||||
+ " to \"" + configManager.formatPath(backupsFolder) + "\"");
|
||||
}
|
||||
|
||||
Path readMeFile = backupsFolder.resolve("README.txt");
|
||||
if (!Files.isRegularFile(readMeFile)) {
|
||||
try {
|
||||
Files.write(readMeFile, Collections.singletonList(
|
||||
"This folder is used to backup configuration files before automatically upgrading them to a newer format."
|
||||
));
|
||||
} catch (IOException ignore) {
|
||||
// The file is not important
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Path getAlternativeCopyFile(Path file, int copyIndex) {
|
||||
|
Loading…
Reference in New Issue
Block a user