Commit 4fc7adf
fix: restore CWD after local_preview MCP tool to support subdirectory workspaces (#390)
When the MCP server is started from a subdirectory of a git repository,
createLocalPreviewRun archives from that subdirectory rather than the repo
root, causing Spacelift to fail with "project root ... does not exist".
Save the original CWD before calling createLocalPreviewRun with
FindRepositoryRoot=true (same as the CLI), then defer a restore so the
long-running MCP server process has its working directory restored after
each call.
Co-authored-by: Rocky Olsen <rolsen@lucidchart.com>1 parent 7b8c3c8 commit 4fc7adf
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
639 | 640 | | |
640 | 641 | | |
641 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
642 | 652 | | |
643 | 653 | | |
644 | 654 | | |
| |||
649 | 659 | | |
650 | 660 | | |
651 | 661 | | |
652 | | - | |
| 662 | + | |
653 | 663 | | |
654 | 664 | | |
655 | 665 | | |
| |||
0 commit comments