Skip to content

Commit

Permalink
fix: auto-build not needed for build (keycloak#26099)
Browse files Browse the repository at this point in the history
closes keycloak#26075

Signed-off-by: Steve Hawkins <[email protected]>
  • Loading branch information
shawkins authored Jan 23, 2024
1 parent ea5888e commit 93e9078
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ private static boolean shouldSkipRebuild(List<String> cliArgs, String currentCom
return cliArgs.contains("--help")
|| cliArgs.contains("-h")
|| cliArgs.contains("--help-all")
|| currentCommandName.equals(Build.NAME)
|| currentCommandName.equals(ShowConfig.NAME)
|| currentCommandName.equals(Tools.NAME);
}
Expand Down Expand Up @@ -217,13 +218,14 @@ private static int runReAugmentation(List<String> cliArgs, CommandLine cmd) {

List<String> configArgsList = new ArrayList<>(cliArgs);

configArgsList.replaceAll(arg -> replaceCommandWithBuild(getCurrentCommandSpec(cliArgs, cmd.getCommandSpec()).getCommandName(), arg));
String commandName = getCurrentCommandSpec(cliArgs, cmd.getCommandSpec()).getCommandName();
configArgsList.replaceAll(arg -> replaceCommandWithBuild(commandName, arg));
configArgsList.removeIf(Picocli::isRuntimeOption);

exitCode = cmd.execute(configArgsList.toArray(new String[0]));

if(!isDevMode() && exitCode == cmd.getCommandSpec().exitCodeOnSuccess()) {
cmd.getOut().printf("Next time you run the server, just run:%n%n\t%s %s %s %s%n%n", Environment.getCommand(), getCurrentCommandSpec(cliArgs, cmd.getCommandSpec()).getCommandName(), OPTIMIZED_BUILD_OPTION_LONG, String.join(" ", getSanitizedRuntimeCliOptions()));
cmd.getOut().printf("Next time you run the server, just run:%n%n\t%s %s %s %s%n%n", Environment.getCommand(), commandName, OPTIMIZED_BUILD_OPTION_LONG, String.join(" ", getSanitizedRuntimeCliOptions()));
}

return exitCode;
Expand Down

0 comments on commit 93e9078

Please sign in to comment.