Skip to content

Commit bebb068

Browse files
committed
Fix realpath issues SAP#41
1 parent cea71f3 commit bebb068

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cf_cli_java_plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
569569
for _, requiredTool := range command.RequiredTools {
570570
logVerbose("Setting up required tool: %s", requiredTool)
571571
uppercase := strings.ToUpper(requiredTool)
572-
var toolCommand = fmt.Sprintf("%s_COMMAND=$(realpath $(find -executable -name %s | head -1 | tr -d [:space:])); if [ -z \"${%s_COMMAND}\" ]; then echo \"%s not found\"; exit 1; fi", uppercase, requiredTool, uppercase, requiredTool)
572+
var toolCommand = fmt.Sprintf(`%[1]s_TOOL_PATH=$(find -executable -name %[2]s | head -1 | tr -d [:space:]); if [ -z "$%[1]s_TOOL_PATH" ]; then echo "%[2]s not found"; exit 1; fi; %[1]s_COMMAND=$(realpath "$%[1]s_TOOL_PATH")`, uppercase, requiredTool)
573573
if requiredTool == "jcmd" {
574574
// add code that first checks whether asprof is present and if so use `asprof jcmd` instead of `jcmd`
575575
remoteCommandTokens = append(remoteCommandTokens, toolCommand, "ASPROF_COMMAND=$(realpath $(find -executable -name asprof | head -1 | tr -d [:space:])); if [ -n \"${ASPROF_COMMAND}\" ]; then JCMD_COMMAND=\"${ASPROF_COMMAND} jcmd\"; fi")

0 commit comments

Comments
 (0)