mirror of https://github.com/databricks/cli.git
use filepath.Abs to FindLeafInTree
This commit is contained in:
parent
d99bf3ac74
commit
2e102b7c1a
|
@ -136,7 +136,10 @@ func fetchRepositoryInfoDotGit(ctx context.Context, path string) (RepositoryInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
func FindLeafInTree(p string, leafName string) (string, error) {
|
func FindLeafInTree(p string, leafName string) (string, error) {
|
||||||
var err error
|
p, err := filepath.Abs(p)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
for i := 0; i < 10000; i++ {
|
for i := 0; i < 10000; i++ {
|
||||||
_, err = os.Stat(filepath.Join(p, leafName))
|
_, err = os.Stat(filepath.Join(p, leafName))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue