mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-30 22:49:06 +07:00
Updated bundles with proper spacing
This commit is contained in:
@ -1,23 +1,21 @@
|
||||
package mindustry.tools;
|
||||
|
||||
import arc.struct.*;
|
||||
import arc.files.*;
|
||||
import arc.func.*;
|
||||
import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import arc.util.io.*;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class BundleLauncher{
|
||||
|
||||
public static void main(String[] args) throws Exception{
|
||||
File file = new File("bundle.properties");
|
||||
public static void main(String[] args){
|
||||
OrderedMap<String, String> base = new OrderedMap<>();
|
||||
PropertiesUtils.load(base, new InputStreamReader(new FileInputStream(file)));
|
||||
PropertiesUtils.load(base, Fi.get("bundle.properties").reader());
|
||||
Array<String> removals = new Array<>();
|
||||
String str = Fi.get("bundle.properties").readString();
|
||||
ObjectSet<String> newlines = Array.with(str.split("\n")).select(l -> l.contains(" = ") && str.indexOf(l) + l.length() < str.length() - 2 && str.charAt(str.indexOf(l) + l.length() + 1) == '\n').map(l -> l.split(" = ")[0]).asSet();
|
||||
Fi.get(".").walk(child -> {
|
||||
if(child.name().equals("bundle.properties") || child.isDirectory() || child.toString().contains("output"))
|
||||
return;
|
||||
if(child.name().equals("bundle.properties") || child.toString().contains("output")) return;
|
||||
|
||||
Log.info("Parsing bundle: {0}", child);
|
||||
|
||||
@ -46,7 +44,7 @@ public class BundleLauncher{
|
||||
}
|
||||
}
|
||||
|
||||
Func2<String, String, String> processor = (key, value) -> (key + " = " + value).replace("\\", "\\\\").replace("\n", "\\n") + "\n";
|
||||
Func2<String, String, String> processor = (key, value) -> (key + " = " + value).replace("\\", "\\\\").replace("\n", "\\n") + "\n" + (newlines.contains(key) ? "\n" : "");
|
||||
Fi output = child.sibling("output/" + child.name());
|
||||
|
||||
Log.info("&lc{0} keys added.", added);
|
||||
|
Reference in New Issue
Block a user