Skip to content

variable to get the current folder name #736

@thebit94dev

Description

@thebit94dev

Hi,

Is there a way or variable to get the folder name of the running devcontainer.json (after selecting "Reopen in Container" in VSCode)?

My setup is:

repo
   .devcontainer/
        container1/
             devcontainer.json
        container2/
             devcontainer.json

I need to obtain "container1" or "container2" depending on which devcontainer.json is active/selected.

Note: ${localWorkspaceFolderBasename} returns only the main repository folder name, and ${localWorkspaceFolder} returns the full path up to the main repo folder, so neither reflects the devcontainer subfolder.

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions