Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

Commit

Permalink
Redirect update script output to update.log in Application Support
Browse files Browse the repository at this point in the history
  • Loading branch information
tagavari committed Jul 5, 2021
1 parent 55b7765 commit 7ccd5b9
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,12 @@ private static void installUpdate(String downloadURL) {

String script = new String(Main.class.getClassLoader().getResourceAsStream("installUpdate.sh").readAllBytes());

File outputFile = new File(Constants.applicationSupportDir, "update.log");
if(outputFile.exists()) outputFile.delete();

ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.command("sh", "-c", script, "install", pathUpdate);
processBuilder.redirectOutput(new File(System.getProperty("user.home") + "/Downloads/log.txt"));
processBuilder.redirectOutput(outputFile);
processBuilder.start();
} catch(IOException exception) {
//Logging the error
Expand Down

0 comments on commit 7ccd5b9

Please sign in to comment.