@@ -29,7 +29,7 @@ import (
2929var _ plugin.Plugin = (* JavaPlugin )(nil )
3030
3131// The JavaPlugin is a cf cli plugin that supports taking heap and thread dumps on demand
32- type JavaPlugin struct {
32+ type JavaPlugin struct {
3333 verbose bool
3434}
3535
@@ -732,7 +732,7 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
732732 return "" , fmt .Errorf ("Command execution failed: %w\n Output: %s" , err , strings .Join (output , "\n " ))
733733 }
734734
735- if command .GenerateFiles && ! noDownload {
735+ if command .GenerateFiles {
736736 logVerbose ("Processing file generation and download" )
737737
738738 finalFile := ""
@@ -751,12 +751,17 @@ func (c *JavaPlugin) execute(commandExecutor cmd.CommandExecutor, uuidGenerator
751751 fileName = finalFile
752752 logVerbose ("Found file: %s" , finalFile )
753753 fmt .Println ("Successfully created " + command .FileLabel + " in application container at: " + fileName )
754- } else {
754+ } else if ! noDownload {
755755 logVerbose ("Failed to find file, error: %v" , err )
756756 fmt .Println ("Failed to find " + command .FileLabel + " in application container" )
757757 return "" , err
758758 }
759759
760+ if noDownload {
761+ fmt .Println ("No download requested, skipping file download" )
762+ return strings .Join (output , "\n " ), nil
763+ }
764+
760765 localFileFullPath := localDir + "/" + applicationName + "-" + command .FileNamePart + "-" + uuidGenerator .Generate () + command .FileExtension
761766 logVerbose ("Downloading file to: %s" , localFileFullPath )
762767 err = utils .CopyOverCat (cfSSHArguments , fileName , localFileFullPath )
0 commit comments