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

Pass parent options to a feature it dependsOn #1264

Open
j2udev opened this issue Feb 5, 2025 · 1 comment
Open

Pass parent options to a feature it dependsOn #1264

j2udev opened this issue Feb 5, 2025 · 1 comment

Comments

@j2udev
Copy link

j2udev commented Feb 5, 2025

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?>"
    }
  }
}
@sireeshajonnalagadda
Copy link

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.

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