(input NotebookEditInput, execCtx ExecutionContext)
| 51 | } |
| 52 | |
| 53 | func BackfillNotebookEditInput(input NotebookEditInput, execCtx ExecutionContext) NotebookEditInput { |
| 54 | path := input.NotebookPath |
| 55 | if path != "" && !filepath.IsAbs(path) { |
| 56 | cwd := stringFromExecCtx(execCtx, "cwd") |
| 57 | if cwd == "" { |
| 58 | cwd = "." |
| 59 | } |
| 60 | if resolved, err := filepath.Abs(filepath.Join(cwd, path)); err == nil { |
| 61 | path = resolved |
| 62 | } else { |
| 63 | path = filepath.Join(cwd, path) |
| 64 | } |
| 65 | } |
| 66 | return NotebookEditInput{ |
| 67 | NotebookPath: path, |
| 68 | CellID: input.CellID, |
| 69 | NewSource: input.NewSource, |
| 70 | CellType: input.CellType, |
| 71 | EditMode: notebookEditMode(input.EditMode), |
| 72 | } |
| 73 | } |
no test coverage detected