mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-22 22:54:57 +00:00
Use process builder
This commit is contained in:
parent
61fa2063e5
commit
c693373364
1 changed files with 5 additions and 2 deletions
|
@ -23,8 +23,11 @@ public class Command_updatetfm extends FreedomCommand {
|
|||
try {
|
||||
String command = String.format("bash -c \"cd %s; %s\"", directory, path);
|
||||
System.out.println(command);
|
||||
Process uptimeProc = Runtime.getRuntime().exec(command);
|
||||
uptimeProc.waitFor();
|
||||
ProcessBuilder proc = new ProcessBuilder(command);
|
||||
proc.redirectErrorStream(true);
|
||||
Process process = proc.start();
|
||||
process.waitFor();
|
||||
System.out.println(proc.redirectOutput());
|
||||
playerMsg("Updated TFM! Reloading...");
|
||||
Utilities.adminAction(sender.getName(), "Update successful, reloading TFM...", false);
|
||||
Bukkit.dispatchCommand(sender, "plugman reload TotalFreedomMod");
|
||||
|
|
Loading…
Reference in a new issue