Skip to content

Commit e29911c

Browse files
committed
handle git hosted modules when generating docs
1 parent 1ae734d commit e29911c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

rakelib/docs.rake

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,22 @@ begin
122122
end
123123

124124
@local_modules = parser.local_modules.sort.map do |mod|
125-
readme = make_request("https://raw.githubusercontent.com/puppetlabs/bolt/main/modules/#{mod.first}/README.md")
126-
match = readme.match(/## Description(?<desc>.*)## Req/m)
125+
# r10k puts git hosted modules under @local_modules,
126+
# handle the ones with local: true as truely local
127+
if mod[1][:local]
128+
readme = make_request("https://raw.githubusercontent.com/puppetlabs/bolt/main/modules/#{mod.first}/README.md")
129+
match = readme.match(/## Description(?<desc>.*)## Req/m)
130+
description = match[:desc].strip
131+
url = "https://github.com/puppetlabs/bolt/tree/main/modules/#{mod.first}"
132+
else
133+
description = 'See git repo for details'
134+
url = mod[1][:git] || ''
135+
end
127136

128137
{
129138
name: mod.first,
130-
description: match[:desc].strip,
131-
url: "https://github.com/puppetlabs/bolt/tree/main/modules/#{mod.first}"
139+
description: description,
140+
url: url
132141
}
133142
end
134143

0 commit comments

Comments
 (0)