Skip to content

Commit

Permalink
crystal doc checks is_crystal_repo based on any remote (#3896)
Browse files Browse the repository at this point in the history
Instead of checking only origin
  • Loading branch information
MaxLap authored and bcardiff committed Jan 16, 2017
1 parent 87317f2 commit ff314f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compiler/crystal/tools/doc/generator.cr
Expand Up @@ -19,8 +19,8 @@ class Crystal::Doc::Generator
@base_dir = `pwd`.chomp
@types = {} of Crystal::Type => Doc::Type
@repo_name = ""
@is_crystal_repo = false
compute_repository
@is_crystal_repo = @repo_name == "github.com/crystal-lang/crystal"
end

def run
Expand Down Expand Up @@ -283,6 +283,8 @@ class Crystal::Doc::Generator

github_remote_pattern = /github\.com(?:\:|\/)((?:\w|-|_)+)\/((?:\w|-|_|\.)+)/
github_remotes = remotes.lines.select &.match(github_remote_pattern)
@is_crystal_repo = github_remotes.any? { |gr| gr =~ %r{github\.com[/:]crystal-lang/crystal} }

remote = github_remotes.find(&.starts_with?("origin")) || github_remotes.first?
return unless remote

Expand Down

0 comments on commit ff314f9

Please sign in to comment.