Skip to content

Commit

Permalink
Fixed semgrep commandlines
Browse files Browse the repository at this point in the history
  • Loading branch information
sflanker committed Sep 3, 2024
1 parent b8efad4 commit 8e845a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/shell/semgrep.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ func SemgrepVersion(options ...OptionFunc) error {
// Output: JSON report to STDOUT
func SemgrepScan(options ...OptionFunc) error {
o := newOptions(options...)
exe := exec.Command("semgrep", "ci", "--json", "--config", o.semgrep.rules)
exe := exec.Command("semgrep", "scan", "--json", "--config", o.semgrep.rules)
if o.semgrep.experimental {
exe = exec.Command("osemgrep", "ci", "--json", "--experimental", "--config", o.semgrep.rules)
exe = exec.Command("osemgrep", "scan", "--json", "--experimental", "--config", o.semgrep.rules)
}
return run(exe, o)
}
4 changes: 2 additions & 2 deletions pkg/tasks/code-scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ func (t *SemgrepCodeScanTask) Run(ctx context.Context, dstStderr io.Writer) erro
return err
}

semgrepCmd := exec.CommandContext(ctx, "semgrep", "ci", "--json", "--config", t.opts.SemgrepRules)
semgrepCmd := exec.CommandContext(ctx, "semgrep", "scan", "--json", "--config", t.opts.SemgrepRules)
if t.opts.SemgrepExperimental {
semgrepCmd = exec.CommandContext(ctx, "osemgrep", "ci", "--json", "--experimental", "--config", t.opts.SemgrepRules)
semgrepCmd = exec.CommandContext(ctx, "osemgrep", "scan", "--json", "--experimental", "--config", t.opts.SemgrepRules)
}
semgrepCmd.Stdout = t.semgrepFile
err := StreamStderr(semgrepCmd, dstStderr, "semgrep code scan")
Expand Down

0 comments on commit 8e845a7

Please sign in to comment.