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

Find out if it worked #12

Closed
peterbe opened this issue Jun 19, 2020 · 1 comment · Fixed by #17
Closed

Find out if it worked #12

peterbe opened this issue Jun 19, 2020 · 1 comment · Fixed by #17

Comments

@peterbe
Copy link

peterbe commented Jun 19, 2020

If I have a typo (e.g. export EDITOR=cude) or I supply some spec that fails horribly it would be nice to know if it worked. E.g.

if (openEditor(['unicorn.js:5:3'])) {
  console.log('Editor opening working');
} else {
  console.warn('Editor opening failed');
}

Even better if it could be try { } catch instead of a boolean return.

@sindresorhus
Copy link
Owner

The openEditor method would have to be made async and awaited then. We would also have to use Promise.all here:

open-editor/index.js

Lines 70 to 72 in 9c7afcb

for (const file of result.arguments) {
open(file);
}
and properly await it. I don't mind changing it if someone does a good pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants