forked from SteamWar/SteamWar
Fix ServerStarter.tempWorld
This commit is contained in:
@@ -201,7 +201,10 @@ public class ServerStarter {
|
||||
|
||||
private void tempWorld(String template) {
|
||||
worldDir = TEMP_WORLD_PATH;
|
||||
worldSetup = () -> copyWorld(node, template, new File(worldDir, worldName).getPath());
|
||||
worldSetup = () -> {
|
||||
mkdirWorldDir(node, worldDir);
|
||||
copyWorld(node, template, new File(worldDir, worldName).getPath());
|
||||
};
|
||||
worldCleanup = () -> SubserverSystem.deleteFolder(node, new File(worldDir, worldName).getPath());
|
||||
}
|
||||
|
||||
@@ -354,6 +357,10 @@ public class ServerStarter {
|
||||
return serverName.replace(' ', '_').replace("[", "").replace("]", "").replace(".", "");
|
||||
}
|
||||
|
||||
public static void mkdirWorldDir(Node node, String targetDir) {
|
||||
node.execute("mkdir", "p", targetDir);
|
||||
}
|
||||
|
||||
public static void copyWorld(Node node, String template, String target) {
|
||||
node.execute("cp", "-r", template, target);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user