Reduce nesting (#72)

This commit is contained in:
Serge Smertin 2022-09-22 15:03:30 +02:00 committed by GitHub
parent 6258a1637d
commit f27cb7149d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 10 deletions

View File

@ -23,16 +23,15 @@ func getRoot() (string, error) {
if err != nil {
return "", fmt.Errorf(`invalid project root %s="%s": %w`, bricksRoot, path, err)
}
} else {
wd, err := os.Getwd()
if err != nil {
return "", err
}
path, err = folders.FindDirWithLeaf(wd, ConfigFile)
if err != nil {
return "", fmt.Errorf(`unable to locate project root`)
}
return path, nil
}
wd, err := os.Getwd()
if err != nil {
return "", err
}
path, err = folders.FindDirWithLeaf(wd, ConfigFile)
if err != nil {
return "", fmt.Errorf(`unable to locate project root`)
}
return path, nil
}