Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

aaronlehmann
Copy link
Collaborator

The DevContainer allows variable substitutions
such as ${containerEnv:PATH} in certain fields.
envbuilder didn't support this up to this point,
but some devcontainer.json files depend on it.

Closes: #88

The DevContainer allows variable substitutions
such as ${containerEnv:PATH} in certain fields.
envbuilder didn't support this up to this point,
but some devcontainer.json files depend on it.
@aaronlehmann aaronlehmann requested a review from kylecarbs March 5, 2024 19:49
Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Feel free to push a new tag after merging this if you need.

Comment on lines +94 to +101
switch varExpr {
case "localWorkspaceFolder", "containerWorkspaceFolder":
return workspaceFolder
case "localWorkspaceFolderBasename", "containerWorkspaceFolderBasename":
return filepath.Base(workspaceFolder)
default:
return os.Getenv(varExpr)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be helpful to link the reference document here in case future var expressions are added!

@aaronlehmann aaronlehmann merged commit 80010c2 into coder:main Mar 5, 2024
@aaronlehmann aaronlehmann deleted the var-substitutions branch March 5, 2024 21:08
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

Successfully merging this pull request may close these issues.

Devcontainer ${env:VAR} variables not honored
3 participants