mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Improve environment variable building
This commit is contained in:
parent
b0a023fabe
commit
5ab9ff282a
1 changed files with 11 additions and 6 deletions
|
@ -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<String, String> buildEnvironmentVariables(ShellControl sc) throws Exception {
|
||||
LinkedHashMap<String, String> 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<String, String> map = buildEnvironmentVariables(sc);
|
||||
return sc.getShellDialect().assembleCommand(s, map);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue