Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vilmibm
Copy link
Contributor

@vilmibm vilmibm commented Mar 20, 2020

Summary

Changes repo view to default to terminal output. Adds -w/--web to suport previous behavior.
image
(...snip...)
image

blank repo:

image

closes #623

Details

I included only the metadata suggested in #623: full name, description, readme, and url. If a readme is detecting as being not-markdown, it's rendered as plain text. A blank readme is rendered the same as no readme ("No README provided").

Test changes

I added a helper called ExpectLines to our test helpers. I noticed we were copying a pasting a ton
of lines for checking a list of regexes against captured STDOUT and was able to get rid of ~60 lines
from the test suite.

@vilmibm vilmibm requested a review from mislav March 20, 2020 21:25
@vilmibm vilmibm force-pushed the repo-view-terminal branch from 13e1543 to 3459dfa Compare March 20, 2020 21:26
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far!

I would move the API implementation details into the api package and optionally move to the GraphQL API for reading the README

Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks & feels great!

command/repo.go Outdated
openURL := fmt.Sprintf("https://github.com/%s", ghrepo.FullName(toView))
fmt.Fprintf(cmd.ErrOrStderr(), "Opening %s in your browser.\n", displayURL(openURL))
return utils.OpenInBrowser(openURL)
readmeContent, err := api.RepositoryReadme(apiClient, fullName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: if err is not explicitly handled here, we should assign the error to _ instead to signal that we're intentionally discarding the error

@vilmibm vilmibm merged commit 26022bc into master Mar 25, 2020
@mislav mislav deleted the repo-view-terminal branch June 25, 2020 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View a repo in the terminal

2 participants