Automatically run the desktop copier after rebuilding the files.

This avoids potentially forgetting a step and having things not work while testing.
1 files changed, 20 insertions(+), 0 deletions(-)

M src/main/java/com/ajtjp/gearCity/Main.java
M src/main/java/com/ajtjp/gearCity/Main.java +20 -0
@@ 19,6 19,7 @@ import com.ajtjp.gearCity.CityInfoFile.X
 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 @@ public class Main {
         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<String> citiesAlreadyExisting, CreateCityDB cityDB) {