Skip to content

Commit cb32ba5

Browse files
committed
#476 Fall back to Smetana by default if graphviz cannot be located
1 parent 63429d2 commit cb32ba5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/asciidoctor-diagram/plantuml/converter.rb

+3-5
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,11 @@ def convert(source, format, options)
110110
add_theme_header(headers, options[:theme])
111111
add_size_limit_header(headers, options[:size_limit])
112112

113-
if options[:smetana]
113+
dot = source.find_command('dot', :alt_attrs => ['graphvizdot'], :raise_on_error => false)
114+
if options[:smetana] || !dot
114115
headers['X-Graphviz'] = 'smetana'
115116
else
116-
dot = source.find_command('dot', :alt_attrs => ['graphvizdot'], :raise_on_error => false)
117-
if dot
118-
headers['X-Graphviz'] = ::Asciidoctor::Diagram::Platform.host_os_path(dot)
119-
end
117+
headers['X-Graphviz'] = ::Asciidoctor::Diagram::Platform.host_os_path(dot)
120118
end
121119

122120
if options[:debug]

0 commit comments

Comments
 (0)