Bugfix tournament deletion

This commit is contained in:
Claude Brisson
2024-07-24 09:11:52 +02:00
parent 74af08a592
commit 02e1fb8319

View File

@@ -162,7 +162,7 @@ class FileStore(pathStr: String): Store {
val file = path.resolve(filename).toFile() val file = path.resolve(filename).toFile()
if (!file.exists()) throw Error("File $filename does not exist") if (!file.exists()) throw Error("File $filename does not exist")
val history = path.resolve("history").toFile() val history = path.resolve("history").toFile()
if (!history.exists() || !history.mkdir()) { if (!history.exists() && !history.mkdir()) {
throw Error("cannot create 'history' sub-directory") throw Error("cannot create 'history' sub-directory")
} }
file.renameTo(path.resolve("history/${filename}-${timestamp}").toFile()) file.renameTo(path.resolve("history/${filename}-${timestamp}").toFile())