Skip to content

Commit ff314f9

Browse files
MaxLapbcardiff
authored andcommitted
crystal doc checks is_crystal_repo based on any remote (#3896)
Instead of checking only origin
1 parent 87317f2 commit ff314f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/compiler/crystal/tools/doc/generator.cr

+3-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class Crystal::Doc::Generator
1919
@base_dir = `pwd`.chomp
2020
@types = {} of Crystal::Type => Doc::Type
2121
@repo_name = ""
22+
@is_crystal_repo = false
2223
compute_repository
23-
@is_crystal_repo = @repo_name == "github.com/crystal-lang/crystal"
2424
end
2525

2626
def run
@@ -283,6 +283,8 @@ class Crystal::Doc::Generator
283283

284284
github_remote_pattern = /github\.com(?:\:|\/)((?:\w|-|_)+)\/((?:\w|-|_|\.)+)/
285285
github_remotes = remotes.lines.select &.match(github_remote_pattern)
286+
@is_crystal_repo = github_remotes.any? { |gr| gr =~ %r{github\.com[/:]crystal-lang/crystal} }
287+
286288
remote = github_remotes.find(&.starts_with?("origin")) || github_remotes.first?
287289
return unless remote
288290

0 commit comments

Comments
 (0)