@@ -105,7 +105,6 @@ func NewCmdBrowse(f *cmdutil.Factory, runF func(*BrowseOptions) error) *cobra.Co
105105}
106106
107107func runBrowse (opts * BrowseOptions ) error {
108-
109108 baseRepo , err := opts .BaseRepo ()
110109 if err != nil {
111110 return fmt .Errorf ("unable to determine base repository: %w\n Use 'gh browse --help' for more information about browse\n " , err )
@@ -115,19 +114,15 @@ func runBrowse(opts *BrowseOptions) error {
115114 if err != nil {
116115 return fmt .Errorf ("unable to create an http client: %w\n Use 'gh browse --help' for more information about browse\n " , err )
117116 }
118-
119117 url := ghrepo .GenerateRepoURL (baseRepo , "" )
120118
121119 if opts .SelectorArg == "" {
122-
123120 if opts .ProjectsFlag {
124121 url += "/projects"
125122 }
126-
127123 if opts .SettingsFlag {
128124 url += "/settings"
129125 }
130-
131126 if opts .WikiFlag {
132127 url += "/wiki"
133128 }
@@ -161,13 +156,15 @@ func runBrowse(opts *BrowseOptions) error {
161156 }
162157 }
163158 }
159+
164160 err = opts .Browser .Browse (url )
165161 if opts .IO .IsStdoutTTY () && err == nil {
166162 fmt .Fprintf (opts .IO .Out , "now opening %s in browser\n " , url )
167163 }
168164
169165 return err
170166}
167+
171168func parseFileArg (fileArg string ) ([]string , error ) {
172169 arr := strings .Split (fileArg , ":" )
173170 if len (arr ) > 2 {
@@ -176,7 +173,6 @@ func parseFileArg(fileArg string) ([]string, error) {
176173 if len (arr ) > 1 && ! isNumber (arr [1 ]) {
177174 return arr , fmt .Errorf ("invalid line number after colon\n Use 'gh browse --help' for more information about browse\n " )
178175 }
179-
180176 return arr , nil
181177}
182178
0 commit comments