mirror of https://github.com/databricks/cli.git
testserver: auto-create directories when importing a file
This commit is contained in:
parent
7cf1f5c635
commit
fe96f80de1
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -81,6 +82,17 @@ func (s *FakeWorkspace) WorkspaceFilesImportFile(path string, body []byte) {
|
||||||
path = "/" + path
|
path = "/" + path
|
||||||
}
|
}
|
||||||
s.files[path] = body
|
s.files[path] = body
|
||||||
|
|
||||||
|
for {
|
||||||
|
p = path.Dir(p)
|
||||||
|
if p == "" || p == "/" {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
s.directories[p] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
return "{}", http.StatusOK
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *FakeWorkspace) JobsCreate(request jobs.CreateJob) Response {
|
func (s *FakeWorkspace) JobsCreate(request jobs.CreateJob) Response {
|
||||||
|
|
Loading…
Reference in New Issue