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

Return value of shell.openPath in openInEditor #272

Merged
merged 7 commits into from
Mar 8, 2024
Merged

Return value of shell.openPath in openInEditor #272

merged 7 commits into from
Mar 8, 2024

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!

index.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

The readme needs to be updated, yes.

@kiavashp
Copy link
Contributor Author

kiavashp commented Mar 4, 2024

@sindresorhus docs updated!

readme.md Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
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