Skip to content

Suggestion about findComposeContainer #659

Closed
@NerdToMars

Description

@NerdToMars

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions