Skip to content

Commit

Permalink
fix: --json hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
iseki0 committed Apr 8, 2022
1 parent d42fa40 commit 5cab1a3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion cmd/scan_run.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
package cmd

import (
"encoding/json"
"fmt"
"github.com/muesli/termenv"
"github.com/spf13/cobra"
"murphysec-cli-simple/base"
"murphysec-cli-simple/display"
"murphysec-cli-simple/inspector"
"murphysec-cli-simple/logger"
"murphysec-cli-simple/utils/must"
"strconv"
)

func scanRun(cmd *cobra.Command, args []string) {
if CliJsonOutput {
ideascanRun(cmd, args)
ctx, e := inspector.NewTaskContext(args[0], base.TaskTypeIdea)
if e != nil {
logger.Err.Println(e)
reportIdeaErr(IdeaScanDirInvalid, "")
SetGlobalExitCode(1)
return
}
ctx.ProjectId = ProjectId
_, e = inspector.Scan(ctx)
if e != nil {
reportIdeaErr(e, "")
SetGlobalExitCode(3)
return
}
fmt.Println(string(must.Byte(json.MarshalIndent(generatePluginOutput(ctx), "", " "))))
return
}
dir := args[0]
Expand Down

0 comments on commit 5cab1a3

Please sign in to comment.