cli icon indicating copy to clipboard operation
cli copied to clipboard

automatic lookup for workspace folder

Open MunsMan opened this issue 1 year ago • 13 comments

Fixes #29 by checking if the current working directory contains a .devcontainer folder.

I added this check after seeing #332

It looks like that the following two if-statements are obsolete. If they are obsolete, just let me know, then I will remove them as well.

MunsMan avatar Feb 27 '23 17:02 MunsMan

I think better reopen this. or feel free to reuse my codes. #387

sarashino avatar Feb 28 '23 05:02 sarashino

@sarashino I just looked at your code and I agree that your isDirectory checks makes sense and I will add it.

Is DEVCONTAINERS_CEILING_DIRECTORIES part of the office spec? Couldn't find it anywhere. What is its purpose?

MunsMan avatar Feb 28 '23 08:02 MunsMan

@MunsMan Thanks. CEILING comes from GIT_CEILING_DIRECTORIES. Mine is almost same implementation as git has.

P.S. Just for quick reply cause I'm not in front of my desk right now.

sarashino avatar Feb 28 '23 08:02 sarashino

@sarashino Thanks for the prompt Response.

I disagree with you about the need of such a feature. I would propose that if the user messes up the working directory, that he should be notified. Otherwise, we might start an unwanted devcontainer or worse. Therefore, I would keep it simple and just check if the cwd contains the .devcontainer directory.

MunsMan avatar Feb 28 '23 08:02 MunsMan

@microsoft-github-policy-service agree

MunsMan avatar Feb 28 '23 11:02 MunsMan

I added this feature to:

  • devcontainer up
  • devcontainer run-user-command
  • devcontainer read-configuration
  • devcontainer exec

Should it be added to devcontainer build as well? Currently, for devcontainer build a workspace-path is required.

MunsMan avatar Feb 28 '23 11:02 MunsMan

Just added a draft for the devcontainer build command. I added the default option, to ensure for typescript that the workspace-folder is a string. I would love to hear about a different implementation approach.

Furthermore, I wondered if the path which should be specified for the build command is even used. Likewise, I could find any reason why it is specified in the docs. With the latest push, you can build with just devcontainer build if you are in your working folder.

MunsMan avatar Feb 28 '23 14:02 MunsMan

This PR seems to have a great usability value, yet I am not seeing what is blocking this from getting merge, as an interested parties I would like to know and potentially help getting this merged.

hpe-ykoehler avatar Aug 03 '23 17:08 hpe-ykoehler

@samruddhikhandale I will take a look at it over the coming days. The Pull Request is that old, I barely remember the codebase.

MunsMan avatar Sep 21 '23 20:09 MunsMan

@samruddhikhandale Do you have a proper styling sheet, or a method to style the code before committing? My personal configuration doesn't match the original styles and using tsfmt doesn't help...

MunsMan avatar Sep 22 '23 18:09 MunsMan

Hey guys, I'm really interested in getting this merged as I think it would greatly improve the CLI. In case @MunsMan has no time to pick this back up I volunteer to help get the feature merged.

Can one of the reviewers (@chrmarti, @samruddhikhandale) post a quick reply with the key points required to get this rolling again?

kita99 avatar Mar 23 '24 15:03 kita99

That would be great. I currently have no use for this and no capacity to write the tests. @kita99 If you can take over, that would be great.

MunsMan avatar Mar 23 '24 20:03 MunsMan

I'm also willing to finish this up so it can get merged. @chrmarti @samruddhikhandale could one of you please summarize what's missing? It's currently the most up-voted feature request, there's a PR already open and more people willing to contribute. All we need is a reviewer, please.

g-arjones avatar Jul 01 '24 19:07 g-arjones