|
259 | 259 | }, |
260 | 260 | { |
261 | 261 | Name: "asprof", |
262 | | - Description: "Run async-profiler commands passed to asprof via --args, copies files in the current folder. Don't use in combination with asprof-* commands. Downloads and deletes all files that are created in the current folder, use '--no-download' to prevent this", |
| 262 | + Description: "Run async-profiler commands passed to asprof via --args, copies files in the current folder. Don't use in combination with asprof-* commands. Downloads and deletes all files that are created in the current folder, if not using 'start' asprof command, use '--no-download' to prevent this.", |
263 | 263 | OnlyOnRecentSapMachine: true, |
264 | 264 | RequiredTools: []string{"asprof"}, |
265 | 265 | GenerateFiles: false, |
@@ -426,6 +426,14 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator |
426 | 426 | } |
427 | 427 | } |
428 | 428 | } |
| 429 | + if command.Name == "asprof" { |
| 430 | + trimmedMiscArgs := strings.TrimLeft(miscArgs, " ") |
| 431 | + if len(trimmedMiscArgs) > 6 && trimmedMiscArgs[:6] == "start " { |
| 432 | + noDownload = true |
| 433 | + } else { |
| 434 | + noDownload = trimmedMiscArgs == "start"; |
| 435 | + } |
| 436 | + } |
429 | 437 | if !command.HasMiscArgs() && commandFlags.IsSet("args") { |
430 | 438 | return "", &InvalidUsageError{message: fmt.Sprintf("The flag %q is not supported for %s", "args", command.Name)} |
431 | 439 | } |
@@ -550,7 +558,6 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator |
550 | 558 | return "", err |
551 | 559 | } |
552 | 560 | if len(files) != 0 { |
553 | | - fmt.Println("Files in the folder: ", files) |
554 | 561 | for _, file := range files { |
555 | 562 | localFileFullPath := localDir + "/" + file |
556 | 563 | err = util.CopyOverCat(cfSSHArguments, fspath+"/"+file, localFileFullPath) |
|
0 commit comments