Age | Commit message (Collapse) | Author |
|
Use the global `Stdout` and `Stderr` variables when running the command
specified by `BROWSER`.
|
|
On Unix, we escape the URL argument by surrounding it with single
quotes. This fails if the URL contains single quotes. It also fails if
the `BROWSER` command contains `%s` not surrounded by single quotes.
Fix this by escaping the single quotes. We might also want to look into
passing the `BROWSER` command and arguments into `exec.Command` directly
instead of through `/bin/sh` and checking if that has an automatic
escaping mechanism we can take advantage of.
|
|
The `BROWSER` environment variable might contain a `%s` format string
that should be replaced by the URL to open. If it's present perform the
replacement. Otherwise, append the URL to the `BROWSER` command as
before.
|
|
So we can add other test cases.
|
|
If the `BROWSER` environment variable is set, open the given URL using
the command specified in the variable.
Run the command in a shell process, either from the `SHELL` environment
variable or `/bin/sh` on Unix OSes. Run it through `cmd` on Windows.
Essentially repurposes my code from
https://github.com/pkg/browser/pull/14.
|