vscli
vscli copied to clipboard
Specifying a custom container path does not work.
vscli open -b force-container -c /home/me/projects/vscli/.devcontainer/devcontainer.json /workspace/vscli/tests
Error:
0: Path /workspace/vscli/subfolder does not exist
Location:
src/workspace.rs:86
Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Does not work.
This is because the second path needs to be specified as a path which is outside the container and it needs to point to an actual vscode workspace.
So this works for example:
vscli open -b force-container -c /home/michi/dev/vscli/.devcontainer/devcontainer.json /home/michi/dev/wslpath2
Works fine.
However, it seems like if the folder you are trying to open does not contain a .devcontainer even though you specified one by URL, this does not work:
❯ vs -b force-container -c /home/michi/dev/vscli/.devcontainer/devcontainer.json /home/michi/dev/wslpath2/target
However, if I select the
target
workspace from this UI.
I can see that the workspace path is relative to the devcontainer:
So it seems like vscode then tries to find the 'nearest' devcontainer and launch relatively from there?
This means we could possible fix this by finding the nearest devcontainer and then appending the relative path from there to there: https://github.com/michidk/vscli/blob/main/src/workspace.rs#L41