-
Notifications
You must be signed in to change notification settings - Fork 10
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
Resolver that runs an external command or script and uses its stdout as the value #45
Comments
I think they are working on a way to let an extension read the terminal content or somehow hook into the stdin/stdout. I don't know the status of this feature. You suggest that somehow the In issue #31 is the request to use the result of a task, also a shell command, in a pickString command. If you can make this a pull request it would be nice. |
Great, I'll look into it. What I'm thinking of is the output of a non interactive script or command that does not need a terminal, and which can safely run every time the variable is expanded. Though I can see the use for an interactive script that could prompt the user, it's not what I need personally. Perhaps the output of a task would be the cleanest way to achieve it. |
Is this different than what's provided by the Tasks Shell Input extension? Using that extension, I'm able to run a shell command and get the output, which is demonstrated below via the
|
Yes, in combination with useFirstResult, this seems to address my needs, though a bit more verbosely. Thank you... |
@tcm0116 The fact that I do not support the I'll look into the Task Shell Input extension how they do it and add it to this extension. |
@tcm0116 You can use the "inputs": [
{
"id": "pickBazelTarget",
"type": "command",
"command": "extension.commandvariable.pickStringRemember",
"args": {
"description": "Choose a target",
"key": "selectedBazelTarget",
"rememberTransformed": true,
"options": [
[ "Previous Target", "${remember:selectedBazelTarget}" ],
[ "Targets", "${command:bazelTargets}" ],
],
"command": {
"bazelTargets": {
"command": "shellCommand.execute",
"args": {
"command": "echo '//...' && bazel query 'kind(cc_*, //...)'",
"cwd": "${workspaceFolder}"
}
}
}
}
}
] |
@rioj7 - that did the trick! Is there a way to resolve the |
@tcm0116 Created a separate issue |
Would it violate some core principle to add a resolver that shells out to a command and uses the output of the command as the variable value? This would allow use of a keychain, database query, git configuration, AWS configuration, etc. to provide the value.
Would a pull request that adds this resolver be useful?
The text was updated successfully, but these errors were encountered: