Skip to content

Commit

Permalink
enhance: add support for disabling file revisions for workspace provider
Browse files Browse the repository at this point in the history
Signed-off-by: Donnie Adams <[email protected]>
  • Loading branch information
thedadams committed Jan 27, 2025
1 parent 45323ce commit 1b6eba9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/sdkserver/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ type writeFileInWorkspaceRequest struct {
workspaceCommonRequest `json:",inline"`
FilePath string `json:"filePath"`
Contents string `json:"contents"`
CreateRevision *bool `json:"createRevision"`
}

func (s *server) writeFileInWorkspace(w http.ResponseWriter, r *http.Request) {
Expand All @@ -207,8 +208,8 @@ func (s *server) writeFileInWorkspace(w http.ResponseWriter, r *http.Request) {
prg,
s.getServerToolsEnv(reqObject.Env),
fmt.Sprintf(
`{"workspace_id": "%s", "file_path": "%s", "body": "%s"}`,
reqObject.ID, reqObject.FilePath, reqObject.Contents,
`{"workspace_id": "%s", "file_path": "%s", "body": "%s", "create_revision": %t}`,
reqObject.ID, reqObject.FilePath, reqObject.Contents, reqObject.CreateRevision == nil || *reqObject.CreateRevision,
),
)
if err != nil {
Expand Down

0 comments on commit 1b6eba9

Please sign in to comment.