parent
21ae1f5b2b
commit
393f0dd429
|
|
@ -124,7 +124,6 @@ func Parse(goGetterSrc string) (*Source, error) {
|
||||||
return nil, InvalidURLError{err: fmt.Sprintf("parse url: missing scheme - probably this is a local file path? %s", goGetterSrc)}
|
return nil, InvalidURLError{err: fmt.Sprintf("parse url: missing scheme - probably this is a local file path? %s", goGetterSrc)}
|
||||||
}
|
}
|
||||||
|
|
||||||
var sourceDir, sourceFile string
|
|
||||||
pathComponents := strings.Split(u.Path, "@")
|
pathComponents := strings.Split(u.Path, "@")
|
||||||
|
|
||||||
if len(pathComponents) != 2 {
|
if len(pathComponents) != 2 {
|
||||||
|
|
@ -138,18 +137,18 @@ func Parse(goGetterSrc string) (*Source, error) {
|
||||||
}
|
}
|
||||||
pathComponents = []string{dir, filepath.Base(u.Path)}
|
pathComponents = []string{dir, filepath.Base(u.Path)}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
dir := pathComponents[0][1:]
|
||||||
|
pathComponents = []string{dir, pathComponents[1]}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceDir = pathComponents[0]
|
|
||||||
sourceFile = pathComponents[1]
|
|
||||||
|
|
||||||
return &Source{
|
return &Source{
|
||||||
Getter: getter,
|
Getter: getter,
|
||||||
User: u.User.String(),
|
User: u.User.String(),
|
||||||
Scheme: u.Scheme,
|
Scheme: u.Scheme,
|
||||||
Host: u.Host,
|
Host: u.Host,
|
||||||
Dir: sourceDir,
|
Dir: pathComponents[0],
|
||||||
File: sourceFile,
|
File: pathComponents[1],
|
||||||
RawQuery: u.RawQuery,
|
RawQuery: u.RawQuery,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue