Push BlueMapVue and add version to index.html on web-app creation

This commit is contained in:
Lukas Rieger (Blue) 2022-09-12 12:02:36 +02:00
parent d64353bf31
commit 9afcb33790
No known key found for this signature in database
GPG Key ID: 2D09EC5ED2687FF2
3 changed files with 16 additions and 2 deletions

@ -1 +1 @@
Subproject commit 0dc79bb9ad37188c9a1d220c3902f9da7d25594c
Subproject commit 65841378855748c78ebe927e8002cd18c96df7ac

View File

@ -173,7 +173,11 @@ private synchronized void loadWorldsAndMaps() throws InterruptedException {
try {
loadMapConfig(entry.getKey(), entry.getValue());
} catch (ConfigurationException ex) {
Logger.global.logError(ex);
Logger.global.logWarning(ex.getFormattedExplanation());
Throwable cause = ex.getRootCause();
if (cause != null) {
Logger.global.logError("Detailed error:", ex);
}
}
}

View File

@ -26,6 +26,7 @@
import com.google.gson.GsonBuilder;
import de.bluecolored.bluemap.common.config.WebappConfig;
import de.bluecolored.bluemap.core.BlueMap;
import de.bluecolored.bluemap.core.logger.Logger;
import de.bluecolored.bluemap.core.resources.adapter.ResourcesGson;
import org.apache.commons.io.FileUtils;
@ -115,6 +116,13 @@ public void updateFiles() throws IOException {
}
}
}
// set version in index.html
Path indexFile = webRoot.resolve("index.html");
String indexContent = Files.readString(indexFile);
indexContent = indexContent.replace("%version%", BlueMap.VERSION);
Files.writeString(indexFile, indexContent);
} finally {
if (!tempFile.delete()) {
Logger.global.logWarning("Failed to delete file: " + tempFile);
@ -125,6 +133,8 @@ public void updateFiles() throws IOException {
@SuppressWarnings("all")
private static class Settings {
private String version = BlueMap.VERSION;
private boolean useCookies = true;
private boolean enableFreeFlight = true;