features
features copied to clipboard
Pass parent options to a feature it dependsOn
Is there a way to pass options from a wrapping feature to a feature it depends on? For example:
{
"name": "Go IDE",
"id": "go-ide",
"version": "0.1.0",
"description": "Install a Go IDE",
"options": {
"go_version": {
"type": "string",
"proposals": [
"1.23.6"
],
"default": "1.23.6",
"description": "Select a Go version"
}
}
"customizations": {
"vscode": {
"settings": {},
"extensions": ["golang.go"]
}
},
"dependsOn": {
"path/to/registry/features/go:0": {
"version": "<can I reference the `go_version` option from above?>"
}
}
}
Hi @j2udev , you cannot directly reference an option like go_version from a wrapping feature and pass it to a dependent feature automatically. However, you can work around this by leveraging environment variables, postCreateCommand, or scripts to set values dynamically.