Skip to content

Commit

Permalink
fix(logs): Fix invalid log path not returning error #3155 #3290
Browse files Browse the repository at this point in the history
Signed-off-by: João Reigota <[email protected]>
  • Loading branch information
joaoReigota1 authored May 12, 2021
1 parent b574773 commit 90ab12e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/console/printer/printer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package printer

import (
"errors"
"io"
"os"
"path/filepath"
Expand All @@ -12,6 +11,7 @@ import (
consoleHelpers "github.com/Checkmarx/kics/internal/console/helpers"
"github.com/Checkmarx/kics/internal/constants"
"github.com/gookit/color"
"github.com/pkg/errors"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -227,7 +227,8 @@ func LogPath(opt interface{}, changed bool) error {
return err
}
}
loggerFile, err = os.OpenFile(filepath.Clean(logPath), os.O_CREATE|os.O_WRONLY, os.ModePerm)

loggerFile, err = os.OpenFile(logPath, os.O_CREATE|os.O_WRONLY, os.ModePerm)
if err != nil {
return err
}
Expand Down

0 comments on commit 90ab12e

Please sign in to comment.