Skip to content

Commit 7823fb7

Browse files
committed
Add clean exit if no git user configuration is set
If the 'user.name' and 'user.email' are not configured, the commit of the generated documentation fail. In this case, the options ['author'] and ['committer'] argument of the Rugged::Commit.create(..), contain a nil content but a string was expected.
1 parent aef6173 commit 7823fb7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/docurium.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ def generate_docs
162162
versions = vers
163163
end
164164

165+
if (@repo.config['user.name'].nil? || @repo.config['user.email'].nil?)
166+
puts "ERROR: 'user.name' or 'user.email' is not configured. Docurium will not be able to commit the documentation"
167+
exit(false)
168+
end
169+
165170
process_project(versions) do |i, version, result|
166171
data, examples = result
167172
sha = @repo.write(data.to_json, :blob)

0 commit comments

Comments
 (0)