Skip to content

Conversation

kiavashp
Copy link
Contributor

@kiavashp kiavashp commented Mar 4, 2024

Summary

This PR returns the value of shell.openPath() in the openInEditor method

Motivation

If someone needs to perform an action only after the path has been opened, there's currently no way to do that, since the async shell.openPath() call isn't waited on, or return value passed through.

Use Case

My specific use case was wanting to quit the app after using this method to open a invalid (not matching the schema) config file. And without the return value I had to use shell.openPath() directly so I could await it.

@kiavashp
Copy link
Contributor Author

kiavashp commented Mar 4, 2024

Please let me know if you think the README should be updated to specify the return value of this method explicitly, or any tests should be added, etc.

I didn't have a model for what those would look like in the rest of the project.

Thanks!

@sindresorhus
Copy link
Owner

The readme needs to be updated, yes.

@kiavashp
Copy link
Contributor Author

kiavashp commented Mar 4, 2024

@sindresorhus docs updated!

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.

2 participants