Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
[RM-5431] Detector fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj-luminal committed May 24, 2021
1 parent 48b02d7 commit 370b898
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/loader/tf.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
type TfDetector struct{}

func (t *TfDetector) DetectFile(i InputFile, opts DetectOptions) (IACConfiguration, error) {
if i.Ext() != ".tf" {
if !opts.IgnoreExt && i.Ext() != ".tf" {
return nil, fmt.Errorf("Expected a .tf extension for %s", i.Path())
}
dir := filepath.Dir(i.Path())
Expand All @@ -55,7 +55,7 @@ func (t *TfDetector) DetectDirectory(i InputDirectory, opts DetectOptions) (IACC
}
}
if !tfExists {
return nil, fmt.Errorf("Directory does not contain a .tf file: %s", i.Path())
return nil, nil
}

return ParseDirectory([]string{}, i.Path(), nil)
Expand Down

0 comments on commit 370b898

Please sign in to comment.