Skip to content

Commit

Permalink
fix(import): Fixed import errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
CarmJos committed Feb 7, 2024
1 parent 2160ae8 commit f233f84
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main/java/cc/carm/app/easyupdater/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static boolean isDebugging() {
}

private static <T> ActionResult executeAll(Map<String, T> tasks, ThrowableTask<T> executor) {
int i = 0, success = 0, failed = 0;
int i = 1, success = 0, failed = 0;
for (Map.Entry<String, T> entry : tasks.entrySet()) {
Logging.debug(" #" + i + " -> Executing " + entry.getKey());
try {
Expand All @@ -65,6 +65,7 @@ private static <T> ActionResult executeAll(Map<String, T> tasks, ThrowableTask<T
e.printStackTrace();
failed++;
}
i++;
}
return new ActionResult(success, failed);
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/cc/carm/app/easyupdater/conf/UpdateConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static UpdateConfig parse(Configuration conf) throws Exception {
List<UpdateConfig> imports = new ArrayList<>();
for (String path : conf.getStringList("imports")) {
try {
Logging.debug("Importing config [" + path + "] ...");
UpdateConfig config = parse(path);
if (config != null) imports.add(config);
} catch (Exception e) {
Expand All @@ -42,8 +43,8 @@ public static UpdateConfig parse(Configuration conf) throws Exception {
}

for (UpdateConfig config : imports) { // Put if not exists
transferActions.forEach(transferActions::putIfAbsent);
mixinActions.forEach(mixinActions::putIfAbsent);
config.transferActions.forEach(transferActions::putIfAbsent);
config.mixinActions.forEach(mixinActions::putIfAbsent);
}

return new UpdateConfig(transferActions, mixinActions);
Expand Down

0 comments on commit f233f84

Please sign in to comment.