Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs command: don't show error on console when not a git repository #3700

Merged
merged 2 commits into from Apr 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/compiler/crystal/tools/doc/generator.cr
Expand Up @@ -300,6 +300,10 @@ class Crystal::Doc::Generator
end

def compute_repository
# check whether inside git work-tree
`git rev-parse --is-inside-work-tree >/dev/null 2>&1`
Copy link
Member

Choose a reason for hiding this comment

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

Is this additional command really necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The below git remote -v will output an error message without this. This is needed.

return unless $?.success?

remotes = `git remote -v`
return unless $?.success?

Expand Down