# HG changeset patch # User Andrew # Date 1661625432 14400 # Sat Aug 27 14:37:12 2022 -0400 # Node ID e282f74cff644cca2e40b3d3a400bc7adfca0741 # Parent a675db0a55e9727c949f3c7d69adfda9c05f46bb Automatically run the desktop copier after rebuilding the files. This avoids potentially forgetting a step and having things not work while testing. diff --git a/src/main/java/com/ajtjp/gearCity/Main.java b/src/main/java/com/ajtjp/gearCity/Main.java --- a/src/main/java/com/ajtjp/gearCity/Main.java +++ b/src/main/java/com/ajtjp/gearCity/Main.java @@ -19,6 +19,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.InputStream; import java.io.OutputStreamWriter; import java.nio.charset.Charset; import java.util.ArrayList; @@ -133,6 +134,25 @@ ExportToCityFile("D:\\Gear City Mods\\Europe Expanded II\\Maps\\Europe Expanded II\\scripts\\City1900.xml", transformer, source); ExportToCityFile("D:\\Gear City Mods\\Europe Expanded II\\Maps\\Europe Expanded II\\scripts\\City2020.xml", transformer, source); + //Copy things over + Process proc = Runtime.getRuntime().exec("D:\\Gear City Mods\\Europe Expanded II\\desktopCopy.bat", null, new File("D:/Gear City Mods/Europe Expanded II/")); + int result = proc.waitFor(); + InputStream es = proc.getErrorStream(); + System.out.println("Result of copy process = " + result); + if (result != 0) { + System.out.println("Errors encountered while copying:"); + int count = 0; + for (;;) { + count = es.available(); + if (count == 0) { + break; + } + byte[] b = new byte[count]; + es.read(b); + String string = new String(b); + System.out.println(string); + } + } } static void AddRegionalCities(RegionDB region, Set citiesAlreadyExisting, CreateCityDB cityDB) {