Tiny fix on browsers.openDefaultBrowser (#13818)

This commit is contained in:
Juan Carlos
2020-03-31 16:22:24 -03:00
committed by GitHub
parent c6586322ba
commit dd44701728

View File

@@ -25,7 +25,8 @@ const osOpenCmd* =
## ``"open"`` on MacOS and Windows, ``"xdg-open"`` on Linux, BSD, etc.
proc openDefaultBrowser*(url: string) =
## opens `url` with the user's default browser. This does not block.
## Opens `url` with the user's default browser. This does not block.
## The URL must not be empty string.
##
## Under Windows, ``ShellExecute`` is used. Under Mac OS X the ``open``
## command is used. Under Unix, it is checked if ``xdg-open`` exists and
@@ -36,6 +37,7 @@ proc openDefaultBrowser*(url: string) =
##
## .. code-block:: nim
## block: openDefaultBrowser("https://nim-lang.org")
doAssert url.len > 0, "URL must not be empty string"
when defined(windows):
var o = newWideCString(osOpenCmd)
var u = newWideCString(url)