Implement locRootPath (#4909)

* Implement locRootPath, and include userinfo, port in locFilePath

* Strip userinfo, port

* Improve readability
This commit is contained in:
Anna Song
2022-12-22 15:15:26 -05:00
committed by GitHub
parent de6162625f
commit aec35009ed
3 changed files with 317 additions and 15 deletions

View File

@@ -296,7 +296,10 @@ func (lc *localizer) localizeDir(path string) (string, error) {
if repo := ldr.Repo(); repo != "" {
// TODO(annasong): You need to check if you can add a localize directory here to store
// the remote file content. There may be a directory that shares the localize directory name.
locPath = locRootPath(path, repo, root)
locPath, err = locRootPath(path, repo, root, lc.fSys)
if err != nil {
return "", err
}
} else {
locPath, err = filepath.Rel(lc.root.String(), root.String())
if err != nil {