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

Suggestion about findComposeContainer #659

Open
NerdToMars opened this issue Oct 19, 2023 · 2 comments
Open

Suggestion about findComposeContainer #659

NerdToMars opened this issue Oct 19, 2023 · 2 comments

Comments

@NerdToMars
Copy link

NerdToMars commented Oct 19, 2023

It's a bit inadequate to search docker container only with project name and services when project name is the basename of the working directory.

`${projectLabel}=${projectName}`,

Can I suggest to either use longer name for project:

return toProjectName(`${cliHost.path.basename(configDir)}_devcontainer`, newProjectName);
}
return toProjectName(cliHost.path.basename(workingDir), newProjectName);

like replace the use of basename with a representation of the full path where each subdirectory is connected with an underscore (_)

function pathToUnderscore(p: string): string {
    return p.split(path.sep).join('_');
}

...
...

if (equalPaths(cliHost.platform, workingDir, cliHost.path.join(configDir, '.devcontainer'))) {
    return toProjectName(`${pathToUnderscore(configDir)}_devcontainer`, newProjectName);
}
return toProjectName(pathToUnderscore(workingDir), newProjectName);
@samruddhikhandale
Copy link
Member

Hi 👋

Thanks for the suggestion, it makes sense to me.

@NerdToMars would you be interested in contributing the change to the CLI? We appreciate support from the community, thanks!

@NerdToMars
Copy link
Author

or is it possible to add more filter in findComposeContainer function

like filter based on devcontainer.local_folder

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

No branches or pull requests

2 participants