Closed mvdan closed 3 years ago
took a first pass at this in bdd456e5cf6e7e1e44938d22cf2b2c17f162ae73 - it just copies the logic from this gist which only calls xdg-open
on linux (no looking for $BROWSER or anything).
When does xdg-open not work?
Be careful because I think your version leaks a bit:
The Wait method will return the exit code and release associated resources once the command exits.
I have code from a previous project that deals with that and also supports a few more edge cases, so I'll just copy-paste that in a second.
When does xdg-open not work?
For the average user, probably never, but it's better to have fallbacks.
Finished in eff46d518ce952551fd5514e8638a02ca6051355 :)
This is a bit trickier than it sounds, because we want to use the link that ipfs prints when it starts. We also want to open the user's choice of browser; check $BROWSER, then xdg-open, then open, then fall back to common browsers like firefox/chromium/chrome.