Commit 6f073c97 authored by 王品堯's avatar 王品堯

增加參數的判斷

parent 1db7e5c2
...@@ -19,12 +19,15 @@ public class LanguageFileCompare { ...@@ -19,12 +19,15 @@ public class LanguageFileCompare {
public static void main(String[] args) { public static void main(String[] args) {
try { try {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
if (args.length > 0) {
Path originPath = Paths.get(args[0]); Path originPath = Paths.get(args[0]);
JsonNode twJson = objectMapper.readTree(new String(Files.readAllBytes(originPath))); JsonNode twJson = objectMapper.readTree(new String(Files.readAllBytes(originPath)));
Set<String> originSet = new HashSet<>(); Set<String> originSet = new HashSet<>();
addKeys("", twJson, originSet, new ArrayList<>()); addKeys("", twJson, originSet, new ArrayList<>());
IntStream.range(1, args.length).forEach(i -> findMissingKeys(Paths.get(args[i]), originSet)); IntStream.range(1, args.length)
.forEach(i -> findMissingKeys(Paths.get(args[i]), originSet));
}
} catch (Exception e) { } catch (Exception e) {
log.error("{} is not exists or not json files.", args[0], e); log.error("{} is not exists or not json files.", args[0], e);
System.exit(1); System.exit(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment