From 6cf9346dfd1c69a6db69720360dc11978c2dd5c6 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Tue, 20 Mar 2018 18:45:21 -0700 Subject: [PATCH] configs/configload: Helper for recognizing a config dir (or not) This is just a small wrapper around the parser's IsConfigDir method, for convenience and for law of demeter. --- configs/configload/loader.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configs/configload/loader.go b/configs/configload/loader.go index 45e60f77c..23bf39fc5 100644 --- a/configs/configload/loader.go +++ b/configs/configload/loader.go @@ -84,3 +84,10 @@ func (l *Loader) Parser() *configs.Parser { func (l *Loader) Sources() map[string][]byte { return l.parser.Sources() } + +// IsConfigDir returns true if and only if the given directory contains at +// least one Terraform configuration file. This is a wrapper around calling +// the same method name on the loader's parser. +func (l *Loader) IsConfigDir(path string) bool { + return l.parser.IsConfigDir(path) +}