mirror of https://github.com/databricks/cli.git
use path.Join to add /Workspace prefix
This commit is contained in:
parent
242b53a23d
commit
d204a9380a
|
@ -5,6 +5,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/databricks/cli/libs/dbr"
|
"github.com/databricks/cli/libs/dbr"
|
||||||
|
@ -83,11 +84,11 @@ func fetchRepositoryInfoAPI(ctx context.Context, path vfs.Path, w *databricks.Wo
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ensureWorkspacePrefix(path string) string {
|
func ensureWorkspacePrefix(p string) string {
|
||||||
if !strings.HasPrefix(path, "/Workspace/") {
|
if !strings.HasPrefix(p, "/Workspace/") {
|
||||||
return "/Workspace/" + path
|
return path.Join("/Workspace", p)
|
||||||
}
|
}
|
||||||
return path
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
func fetchRepositoryInfoDotGit(ctx context.Context, path vfs.Path) (GitRepositoryInfo, error) {
|
func fetchRepositoryInfoDotGit(ctx context.Context, path vfs.Path) (GitRepositoryInfo, error) {
|
||||||
|
|
Loading…
Reference in New Issue