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.
This commit is contained in:
Martin Atkins 2018-03-20 18:45:21 -07:00
parent 5dd6b839d0
commit 6cf9346dfd
1 changed files with 7 additions and 0 deletions

View File

@ -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)
}