Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specifying a custom container path does not work. #82

Open
lohrm-stabl opened this issue Mar 11, 2024 · 1 comment
Open

Specifying a custom container path does not work. #82

lohrm-stabl opened this issue Mar 11, 2024 · 1 comment
Labels
bug Something isn't working no-stale

Comments

@lohrm-stabl
Copy link
Collaborator

lohrm-stabl commented Mar 11, 2024

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.

@michidk michidk added no-stale bug Something isn't working labels Mar 12, 2024
@michidk
Copy link
Owner

michidk commented Sep 14, 2024

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 

image
However, if I select the target workspace from this UI.
image

I can see that the workspace path is relative to the devcontainer:
image

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-stale
Projects
None yet
Development

No branches or pull requests

2 participants