Skip to content

Commit

Permalink
Allow redirects when downloading (github mainly) (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Caedis authored Jan 5, 2025
1 parent 540ea88 commit 25b3d54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/GTNHNightlyUpdater/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public static void main(String[] args) {
}

} catch (CommandLine.ParameterException e) {
log.fatal(e);
CommandLine.usage(options, System.out);
System.exit(2);
} catch (Exception e) {
Expand Down Expand Up @@ -93,7 +92,7 @@ static class Options {
@CommandLine.Option(names = {"-l", "--latest"}, description = "Use the latest version of GTNH org mods instead of the latest nightly.")
private boolean useLatest = false;

@CommandLine.ArgGroup(exclusive = false, multiplicity = "0..*")
@CommandLine.ArgGroup(exclusive = false, multiplicity = "1..*")
List<Instance> instances;

static class Instance {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/GTNHNightlyUpdater/Updater.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void updateModsFromMaven(Assets.Asset asset) throws IOException, InterruptedExce

void cacheMods(Assets.Asset asset, Path modCacheDir) throws IOException, InterruptedException {
log.info("Caching nightly mods");
@Cleanup HttpClient client = HttpClient.newHttpClient();
@Cleanup HttpClient client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.NORMAL).build();
for (val mod : asset.mods()) {
if ((mod.side() != null && mod.side().equals("NONE")) || mod.versions().isEmpty()) {
continue;
Expand Down

0 comments on commit 25b3d54

Please sign in to comment.