Skip to content

Commit

Permalink
Merge pull request #225 from Pexers/main
Browse files Browse the repository at this point in the history
Add support for Boolean extra-var interpretation
  • Loading branch information
jonesbusy authored Jun 18, 2024
2 parents ae6975e + 65a1c42 commit 8d0cadc
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,17 @@ public ArgumentListBuilder appendExtraVars(ArgumentListBuilder args) {
value = Util.singleQuote(value);
}
StringBuilder sb = new StringBuilder();
sb.append(envVars.expand(var.getKey())).append("=").append(value);
// assuming Groovy representation for Boolean values
if (value.equals("true") || value.equals("false")) {
// JSON format is required for Boolean variables
sb.append("{\"")
.append(envVars.expand(var.getKey()))
.append("\":")
.append(value)
.append("}");
} else {
sb.append(envVars.expand(var.getKey())).append("=").append(value);
}
if (var.isHidden()) {
args.addMasked(sb.toString());
} else {
Expand Down

0 comments on commit 8d0cadc

Please sign in to comment.