Skip to content

Commit

Permalink
support windows
Browse files Browse the repository at this point in the history
Signed-off-by: Simar <[email protected]>
  • Loading branch information
simar7 committed Apr 6, 2023
1 parent 80c4e43 commit 535f19c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/fanal/analyzer/config/terraform/terraform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package terraform
import (
"bytes"
"context"
"path/filepath"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -30,7 +31,7 @@ func TestConfigAnalyzer_Analyze(t *testing.T) {
types.MisconfPostHandler: {
{
Type: types.Terraform,
Path: "path/to/main.tf",
Path: filepath.Clean("path/to/main.tf"),
Content: []byte{},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/misconf/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func findCommonPrefix(files []types.File) string {

func getRootDir(filePath string) (string, error) {
var rootDir string
absPath, err := filepath.Abs(filePath)
absPath, err := filepath.Abs(filepath.Clean(filePath))
if err != nil {
return "", err
}
Expand Down

0 comments on commit 535f19c

Please sign in to comment.