From 4d9a7fd03d8ef69b52584103a9649d41f5652ff9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 25 Feb 2020 14:22:25 +0100 Subject: Exec helper: Honor environment from file --- src/main/java/org/openslx/satserver/util/Exec.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/main/java/org/openslx/satserver/util/Exec.java b/src/main/java/org/openslx/satserver/util/Exec.java index e273409..7fbf686 100644 --- a/src/main/java/org/openslx/satserver/util/Exec.java +++ b/src/main/java/org/openslx/satserver/util/Exec.java @@ -5,6 +5,8 @@ import java.io.File; import java.io.IOException; import java.io.InputStreamReader; +import org.openslx.taskmanager.api.Environment; + public class Exec { @@ -29,6 +31,10 @@ public class Exec { ProcessBuilder pb = new ProcessBuilder( command ); pb.directory( new File( cwd ) ); + if (Environment.get() != null ) { + pb.environment().clear(); + pb.environment().putAll( Environment.get() ); + } Process p = null; Thread[] list = null; try { -- cgit v1.2.3-55-g7522