From ec321f288bd34fd77f9f974b181f968e712bc669 Mon Sep 17 00:00:00 2001 From: Katsuhiko YOSHIDA Date: Sun, 6 Aug 2023 19:17:12 +0900 Subject: [PATCH] Don't open invalid URL --- cmd/root.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index a7b0635..c448891 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -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) }