mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 18:29:53 +00:00
if interactive, only return the print archivePath to stdout; if non-interactive, print whole analysis as json
This commit is contained in:
@@ -195,12 +195,17 @@ the %s Admin Console to begin analysis.`
|
||||
return nil
|
||||
}
|
||||
|
||||
nonInteractiveOutput.ArchivePath = response.ArchivePath
|
||||
output, err := nonInteractiveOutput.FormattedAnalysisOutput()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to format non-interactive output")
|
||||
if !interactive {
|
||||
nonInteractiveOutput.ArchivePath = response.ArchivePath
|
||||
output, err := nonInteractiveOutput.FormattedAnalysisOutput()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to format non-interactive output")
|
||||
}
|
||||
fmt.Println(output)
|
||||
return nil
|
||||
}
|
||||
fmt.Println(output)
|
||||
|
||||
fmt.Printf("%s\n", response.ArchivePath)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user