Skip to content

Commit

Permalink
Merge pull request #27 from kyoshidajp/disable_browser_path
Browse files Browse the repository at this point in the history
Disable browser path configuration
  • Loading branch information
kyoshidajp authored Mar 21, 2018
2 parents 9d257af + 35680de commit 6d85e86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 32 deletions.
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,6 @@ $ go get -u github.com/kyoshidajp/tosa
1. Put `tosa` where you want.
1. Add `tosa` path to `$PATH`.

## Configuration

### Browser

Add `browser` in `$HOME/.config/tosa`(which is YAML format). Like this.

```
github.com:
- user: your_account
oauth_token: your_oauth_token
protocol: https
browser: firefox
```

This config file is automatically generated when running without setting environment variable `GITHUB_TOKEN`.

The value is a name or an absolute path. By default, used your system default browser.

## Author

[Katsuhiko YOSHIDA](https://github.com/kyoshidajp)
16 changes: 2 additions & 14 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const (
ExitCodeParseFlagsError
ExitCodeBadArgs
ExitCodePullRequestNotFound
ExitCodeOpenPageError
)

// Debugf prints debug output when EnvDebug is given
Expand Down Expand Up @@ -167,23 +166,12 @@ func openPr(client *APIClient, sha string) int {
return ExitCodePullRequestNotFound
}

browser, err := GetBrowser()
if err != nil {
return ExitCodeOpenPageError
}
Debugf("browser: %s", browser)

url := *pr.HTMLURL
Debugf("URL: %s", url)

var openErr error
if browser == "" {
openErr = open.Run(url)
} else {
openErr = open.RunWith(url, browser)
}
openErr := open.Run(url)
if openErr != nil {
PrintErrorf("Could not open page. Check your browser and URL.")
PrintErrorf("Could not open page.")
return ExitCodeError
}

Expand Down

0 comments on commit 6d85e86

Please sign in to comment.