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

Feature Request: Make context.api.runExecutable return the stdOut as the result of it's promise. #17277

Open
Garethp opened this issue Mar 11, 2025 · 4 comments

Comments

@Garethp
Copy link

Garethp commented Mar 11, 2025

Is your feature request related to a problem? Please describe.
As part of a Game Extension that I'm writing I need to manage a third-party tool. I'd like to do version checking of the third party tool to prompt users to download updates, so I need to execute that tool with --version and read the output to determine what the current version of the tool is. context.api.runExecutable returns Promise<void> and doesn't use the stdOut of the child process.

Describe the solution you'd like
I'd like to see runExecutable return Promise<string?> instead, where it resolves the stdOut of the child process where there is one

Describe alternatives you've considered
I've considered either making the version check itself whether it's the latest version and just exiting with a code of 1 if it's not or just spawning a child process myself in my extension. Neither seem like good solutions when there's already an api for running executables, but for the moment I'll be spawning the child process myself

@ChemGuy1611
Copy link

what's wrong with spawning a child process?

@Garethp
Copy link
Author

Garethp commented Mar 13, 2025

There's nothing wrong with it specifically, but when there's an API function that's already doing everything I need except returning output it feels like unnecessary code

@ChemGuy1611
Copy link

I see where you're coming from. It would probably be better to make a new function rather than changing the existing because that could potentially cause issues with back-compat.

@Garethp
Copy link
Author

Garethp commented Mar 17, 2025

Personally I can't imagine too many uses where you'd check, or rely on, the output of a () => void function, and therefore too many cases where returning something would cause backwards incompatibility. That being said, I don't know all the cases that's why Nagev (I don't know what their handle on Github is) said to file the issue and if they has time he may get around to checking if it's a viable change

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