Skip to content

Commit 9afcb33

Browse files
committed
Push BlueMapVue and add version to index.html on web-app creation
1 parent d64353b commit 9afcb33

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ private synchronized void loadWorldsAndMaps() throws InterruptedException {
173173
try {
174174
loadMapConfig(entry.getKey(), entry.getValue());
175175
} catch (ConfigurationException ex) {
176-
Logger.global.logError(ex);
176+
Logger.global.logWarning(ex.getFormattedExplanation());
177+
Throwable cause = ex.getRootCause();
178+
if (cause != null) {
179+
Logger.global.logError("Detailed error:", ex);
180+
}
177181
}
178182
}
179183

BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/WebFilesManager.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import com.google.gson.GsonBuilder;
2828
import de.bluecolored.bluemap.common.config.WebappConfig;
29+
import de.bluecolored.bluemap.core.BlueMap;
2930
import de.bluecolored.bluemap.core.logger.Logger;
3031
import de.bluecolored.bluemap.core.resources.adapter.ResourcesGson;
3132
import org.apache.commons.io.FileUtils;
@@ -115,6 +116,13 @@ public void updateFiles() throws IOException {
115116
}
116117
}
117118
}
119+
120+
// set version in index.html
121+
Path indexFile = webRoot.resolve("index.html");
122+
String indexContent = Files.readString(indexFile);
123+
indexContent = indexContent.replace("%version%", BlueMap.VERSION);
124+
Files.writeString(indexFile, indexContent);
125+
118126
} finally {
119127
if (!tempFile.delete()) {
120128
Logger.global.logWarning("Failed to delete file: " + tempFile);
@@ -125,6 +133,8 @@ public void updateFiles() throws IOException {
125133
@SuppressWarnings("all")
126134
private static class Settings {
127135

136+
private String version = BlueMap.VERSION;
137+
128138
private boolean useCookies = true;
129139

130140
private boolean enableFreeFlight = true;

0 commit comments

Comments
 (0)