skip lookup for paths starting with ../

Prevent an extra registry lookup for sources starting with ../
This commit is contained in:
James Bardin 2017-10-17 16:40:51 -04:00
parent 402f321abe
commit 6088270c66
1 changed files with 2 additions and 2 deletions

View File

@ -92,8 +92,8 @@ var detectors = []getter.Detector{
}
// these prefixes can't be registry IDs
// "http", "./", "/", "getter::"
var skipRegistry = regexp.MustCompile(`^(http|\./|/|[A-Za-z0-9]+::)`).MatchString
// "http", "../", "./", "/", "getter::", etc
var skipRegistry = regexp.MustCompile(`^(http|[.]{1,2}/|/|[A-Za-z0-9]+::)`).MatchString
// registryDetector implements getter.Detector to detect Terraform Registry modules.
// If a path looks like a registry module identifier, attempt to locate it in