mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-23 08:25:12 +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 {
|
try {
|
||||||
String command = String.format("bash -c \"cd %s; %s\"", directory, path);
|
String command = String.format("bash -c \"cd %s; %s\"", directory, path);
|
||||||
System.out.println(command);
|
System.out.println(command);
|
||||||
Process uptimeProc = Runtime.getRuntime().exec(command);
|
ProcessBuilder proc = new ProcessBuilder(command);
|
||||||
uptimeProc.waitFor();
|
proc.redirectErrorStream(true);
|
||||||
|
Process process = proc.start();
|
||||||
|
process.waitFor();
|
||||||
|
System.out.println(proc.redirectOutput());
|
||||||
playerMsg("Updated TFM! Reloading...");
|
playerMsg("Updated TFM! Reloading...");
|
||||||
Utilities.adminAction(sender.getName(), "Update successful, reloading TFM...", false);
|
Utilities.adminAction(sender.getName(), "Update successful, reloading TFM...", false);
|
||||||
Bukkit.dispatchCommand(sender, "plugman reload TotalFreedomMod");
|
Bukkit.dispatchCommand(sender, "plugman reload TotalFreedomMod");
|
||||||
|
|
Loading…
Reference in a new issue