From bc060240ce2ae27100208a1a21703759bcf57336 Mon Sep 17 00:00:00 2001 From: Stephanie Gawroriski Date: Thu, 3 Oct 2024 23:41:05 +0000 Subject: [PATCH] Dump stderr if it happens and overwrite existing if applicable. --- .../src/main/java/cc/squirreljme/gh/classic/Main.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/github-classic-project-dump/src/main/java/cc/squirreljme/gh/classic/Main.java b/tools/github-classic-project-dump/src/main/java/cc/squirreljme/gh/classic/Main.java index 8a764ce41d..165420ba06 100644 --- a/tools/github-classic-project-dump/src/main/java/cc/squirreljme/gh/classic/Main.java +++ b/tools/github-classic-project-dump/src/main/java/cc/squirreljme/gh/classic/Main.java @@ -16,6 +16,7 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; /** * Main entry point. @@ -58,6 +59,8 @@ public class Main } // Read in everything + System.err.write(StreamUtils.readAll(1048576, + proc.getErrorStream())); return StreamUtils.readAll(1048576, proc.getInputStream()); } @@ -137,7 +140,10 @@ public class Main // Write to disk if (__where.getParent() != null) Files.createDirectories(__where.getParent()); - Files.write(__where, rawJson); + Files.write(__where, rawJson, + StandardOpenOption.TRUNCATE_EXISTING, + StandardOpenOption.CREATE, + StandardOpenOption.WRITE); // Debug System.err.printf(">> %s -> %s%n", -- 2.11.4.GIT