Skip to content

Commit

Permalink
Fix edge case in logging config handling
Browse files Browse the repository at this point in the history
If the user cancelled the install process after the temp logging config
file was created, but before the installer executes, the pack would fail
to install on relaunch. Fix by allowing overwriting of the temp file.
  • Loading branch information
hedgehog1029 committed Jan 1, 2022
1 parent 725f747 commit 28017e8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.*;
import java.util.logging.Level;

Expand Down Expand Up @@ -298,7 +299,7 @@ protected void installLibraries(@NonNull Installer installer,
// Use our embedded replacement

Path tempFile = installer.getTempDir().toPath().resolve(file.getId());
Files.copy(embeddedConfig, tempFile);
Files.copy(embeddedConfig, tempFile, StandardCopyOption.REPLACE_EXISTING);

log.info("Substituting embedded logging config " + file.getId());
installer.queue(new FileMover(tempFile.toFile(), targetFile));
Expand Down

0 comments on commit 28017e8

Please sign in to comment.