mirror of https://github.com/databricks/cli.git
add windows fix
This commit is contained in:
parent
a17876480a
commit
e101f92016
|
@ -6,6 +6,7 @@ import (
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"golang.org/x/exp/slices"
|
"golang.org/x/exp/slices"
|
||||||
)
|
)
|
||||||
|
@ -17,6 +18,11 @@ type LocalClient struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewLocalClient(root string) (Filer, error) {
|
func NewLocalClient(root string) (Filer, error) {
|
||||||
|
if runtime.GOOS == "windows" && root == "/" {
|
||||||
|
// Windows paths require a drive specified. This allows use to create
|
||||||
|
// local filers at the root of a windows file system
|
||||||
|
return &LocalClient{root: NewRootPath("")}, nil
|
||||||
|
}
|
||||||
return &LocalClient{
|
return &LocalClient{
|
||||||
root: NewRootPath(root),
|
root: NewRootPath(root),
|
||||||
}, nil
|
}, nil
|
||||||
|
|
Loading…
Reference in New Issue