Skip to content

Commit

Permalink
Merge pull request #9 from kyoshidajp/block_opening_invalid_url
Browse files Browse the repository at this point in the history
Don't open invalid URL
  • Loading branch information
kyoshidajp authored Aug 6, 2023
2 parents c608bb7 + ec321f2 commit 9b2390b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func Execute() {
repositoryURL := getRepositoryURL()
prURL := GetPrURL(repositoryURL, currentBranch)

if !strings.HasPrefix(prURL, GitHubURL) {
message := fmt.Sprintf("Can't open URL: %s", prURL)
log.Fatal(message)
}

browser.OpenURL(prURL)
}

Expand Down

0 comments on commit 9b2390b

Please sign in to comment.