Skip to content

Commit

Permalink
Fix static report output path (#346)
Browse files Browse the repository at this point in the history
fix static report output path

Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan authored Oct 2, 2024
1 parent eb69d7d commit ac5f7cd
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions cmd/analyze-bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ func (b *analyzeBinCommand) buildStaticReportFile(ctx context.Context, staticRep
applicationName := []string{filepath.Base(b.input)}
outputAnalysis := []string{filepath.Join(b.output, "output.yaml")}
outputDeps := []string{filepath.Join(b.output, "dependencies.yaml")}
outputJSPath := filepath.Join(staticReportPath, "public", "output.js")
outputJSPath := filepath.Join(staticReportPath, "output.js")

if depsErr {
outputDeps = []string{}
Expand All @@ -796,22 +796,12 @@ func (b *analyzeBinCommand) buildStaticReportFile(ctx context.Context, staticRep
}

func (b *analyzeBinCommand) buildStaticReportOutput(ctx context.Context, log *os.File) error {
outputFileSrcPath := filepath.Join(b.homeKantraDir, "static-report", "public")
outputFileDestPath := filepath.Join(b.homeKantraDir, "static-report", "static-report")

// move output.js file to build dir
cmd := exec.Command("cp", filepath.Join(outputFileSrcPath, "output.js"),
filepath.Join(outputFileDestPath, "output.js"))
cmd.Stdout = log
err := cmd.Run()
if err != nil {
return err
}
outputFileDestPath := filepath.Join(b.homeKantraDir, "static-report")

// move build dir to user output dir
cmd = exec.Command("cp", "-r", outputFileDestPath, b.output)
cmd := exec.Command("cp", "-r", outputFileDestPath, b.output)
cmd.Stdout = log
err = cmd.Run()
err := cmd.Run()
if err != nil {
return err
}
Expand Down

0 comments on commit ac5f7cd

Please sign in to comment.