Skip to content

Commit

Permalink
Fix for WFGP-280, Finalize script execution is broken a when stabilit…
Browse files Browse the repository at this point in the history
…y level is set
  • Loading branch information
Jean Francois Denise committed Apr 10, 2024
1 parent d298fd3 commit cfbb3f2
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,25 @@ public void postInstall(ProvisioningRuntime runtime) throws ProvisioningExceptio
Path script;
try {
try {
byte[] content = Files.readAllBytes(finalizeCli);
String stabilityLevel = getStabilityLevel();
byte[] content;
if (stabilityLevel != null && !stabilityLevel.isEmpty()) {
List<String> lines = Files.readAllLines(finalizeCli);
StringBuilder builder = new StringBuilder();
// Do we have an embed-server command?
for (String l : lines) {
String trimLine = l.trim();
if (trimLine.startsWith("embed-server")) {
if (!trimLine.contains("--stability=")) {
l += " --stability=" + stabilityLevel;
}
}
builder.append(l).append(System.lineSeparator());
}
content = builder.toString().getBytes();
} else {
content = Files.readAllBytes(finalizeCli);
}
Path tmpDir = runtime.getTmpPath();
if (!Files.exists(tmpDir)) {
Files.createDirectory(tmpDir);
Expand Down

0 comments on commit cfbb3f2

Please sign in to comment.