diff --git a/core/src/main/java/io/xpipe/core/process/CommandBuilder.java b/core/src/main/java/io/xpipe/core/process/CommandBuilder.java index fa9b90a41..8fdd6d475 100644 --- a/core/src/main/java/io/xpipe/core/process/CommandBuilder.java +++ b/core/src/main/java/io/xpipe/core/process/CommandBuilder.java @@ -254,12 +254,7 @@ public class CommandBuilder { return list; } - public String buildFull(ShellControl sc) throws Exception { - if (sc == null) { - return buildSimple(); - } - - var s = buildBase(sc); + public Map buildEnvironmentVariables(ShellControl sc) throws Exception { LinkedHashMap map = new LinkedHashMap<>(); for (var e : environmentVariables.entrySet()) { var v = e.getValue().evaluate(sc); @@ -267,6 +262,16 @@ public class CommandBuilder { map.put(e.getKey(), v); } } + return map; + } + + public String buildFull(ShellControl sc) throws Exception { + if (sc == null) { + return buildSimple(); + } + + var s = buildBase(sc); + Map map = buildEnvironmentVariables(sc); return sc.getShellDialect().assembleCommand(s, map); }