Skip to content

Commit 761de12

Browse files
Fix incorrect remote path arg to APIs in windows on bricks sync (#101)
Integration tests testing sync on ubuntu are green: <img width="794" alt="Screenshot 2022-11-25 at 2 05 11 PM" src="https://user-images.githubusercontent.com/88374338/203991936-f0478c35-5d97-429b-b373-f050d9a90cff.png"> @fjakobs tested this on windows manually
1 parent 8e786d7 commit 761de12

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/sync/watchdog.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ const MaxRequestsInFlight = 20
4444
//
4545
// The workspace file system backend strips .py from the file name if the python
4646
// file is a notebook
47-
func putFile(ctx context.Context, path string, content io.Reader) error {
47+
func putFile(ctx context.Context, remotePath string, content io.Reader) error {
4848
wsc := project.Get(ctx).WorkspacesClient()
4949
// workspace mkdirs is idempotent
50-
err := wsc.Workspace.MkdirsByPath(ctx, filepath.Dir(path))
50+
err := wsc.Workspace.MkdirsByPath(ctx, path.Dir(remotePath))
5151
if err != nil {
5252
return fmt.Errorf("could not mkdir to put file: %s", err)
5353
}
@@ -57,7 +57,7 @@ func putFile(ctx context.Context, path string, content io.Reader) error {
5757
}
5858
apiPath := fmt.Sprintf(
5959
"/api/2.0/workspace-files/import-file/%s?overwrite=true",
60-
strings.TrimLeft(path, "/"))
60+
strings.TrimLeft(remotePath, "/"))
6161
return apiClient.Do(ctx, http.MethodPost, apiPath, content, nil)
6262
}
6363

0 commit comments

Comments
 (0)