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:
parent
65177edd1e
commit
97227a5c70
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue