config/module: fix detection of file paths on Windows

Absolute file paths were not correctly detected by module.Detect
when using url.Parse to parse the source URL. Wrap the detection
with urlParse to properly handle file path detections on Windows.

Fixes command test failures on Windows.
This commit is contained in:
Emil Hessman 2015-01-28 10:40:19 +01:00
parent 65177edd1e
commit 97227a5c70
1 changed files with 2 additions and 2 deletions

View File

@ -38,10 +38,10 @@ func Detect(src string, pwd string) (string, error) {
// Separate out the subdir if there is one, we don't pass that to detect
getSrc, subDir := getDirSubdir(getSrc)
u, err := url.Parse(getSrc)
u, err := urlParse(getSrc)
if err == nil && u.Scheme != "" {
// Valid URL
return src, nil
return u.String(), nil
}
for _, d := range Detectors {