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

Clarify working directory for lifecycle script execution #436

Open
PerMildner opened this issue Feb 27, 2024 · 4 comments
Open

Clarify working directory for lifecycle script execution #436

PerMildner opened this issue Feb 27, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@PerMildner
Copy link

The documentation or the initializeCommand says:

A command string or list of command arguments to run on the host machine before the container is created.

This is insufficient since it does not say anything about the working directory when the command is run.

This is a general problem with the reference documentation, every time something is run (on the host or in the container) the script writer needs to know the working directory.

PS. The same page uses "(list of) command arguments to run" but I cannot see that "command arguments" is defined anywhere, and it is not standard POSIX terminology. I find the term confusing since the immediate question then is "which command will get those 'command arguments' as its arguments?"

@samruddhikhandale
Copy link
Member

Hi 👋

This is insufficient since it does not say anything about the working directory when the command is run.

The document does mention "⚠️ The command is run wherever the source code is located on the host. For cloud services, this is in the cloud." which already answers your question about the working directory.

Let us know which bit of information is confusing to you, happy to enhance the docs. Thanks!

@PerMildner
Copy link
Author

Thank you for looking at this.

I initially interpreted your quoted text in the same way as you, i.e. that the text you quoted tries to say something about the working directory. However, typically "the source code is located" in many different directories, and "in the cloud" is irrelevant for file structure, so I concluded that the text you quoted actually tries to emphasize that the code is not run in the dev container.

So, even if your interpretation is correct, the documentation is unclear and imprecise regarding working directory, and the descriptions of the other lifecycle scripts also need information about working directory (and their descriptions do no have any text that could be misunderstood as talking about working directory).

@samruddhikhandale
Copy link
Member

Thanks for explaining. Looping in @bamurtaugh for doc enhancements.

@samruddhikhandale samruddhikhandale added the documentation Improvements or additions to documentation label Feb 28, 2024
@bamurtaugh
Copy link
Member

Thanks for looping me in @samruddhikhandale, and thanks for the discussion @PerMildner! Your feedback on how to clarify our documentation is really valuable.

However, typically "the source code is located" in many different directories

It's helpful to hear this is how the docs may be interpreted. Our intention is to state that the relevant directory is where your devcontainer.json in source code is located. While your project may have many folders/directories within it, the devcontainer.json will be based in one specific directory.

If you have a moment, it'd be fantastic if you could start a PR where you've identified our documentation could be clearer. That way we know we'd be addressing the spot(s) that are most confusing. We'd be more than happy to iterate with you on it too.

Please let us know if you have other questions/feedback, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants