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"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -81,6 +82,17 @@ func (s *FakeWorkspace) WorkspaceFilesImportFile(path string, body []byte) {
|
|||
path = "/" + path
|
||||
}
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue