From 370b898c816e93d4a899fb457e4f781a75e575e5 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 24 May 2021 18:40:35 +0000 Subject: [PATCH] [RM-5431] Detector fixes --- pkg/loader/tf.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/loader/tf.go b/pkg/loader/tf.go index a3ddd49d..c388833b 100644 --- a/pkg/loader/tf.go +++ b/pkg/loader/tf.go @@ -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()) @@ -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)