Skip to content

Commit

Permalink
#453 Don't silently return nil from find_command when raise_on_error …
Browse files Browse the repository at this point in the history
…is true
  • Loading branch information
pepijnve committed Jan 26, 2024
1 parent d5ea6df commit 004d85a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
= Asciidoctor-diagram Changelog

== 2.2.16

Bugfixes::

* Issue #453: Avoid internal error when WaveDrom cannot be located

== 2.2.15

Enhacements::
Expand Down
7 changes: 4 additions & 3 deletions lib/asciidoctor-diagram/diagram_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,10 @@ def find_command(cmd, options = {})

config[cmd_var] = cmd_path

if cmd_path.nil? && options.fetch(:raise_on_error, true)
raise "Could not find the #{cmd_names.map { |c| "'#{c}'" }.join(', ')} executable in PATH; add it to the PATH or specify its location using the '#{attr_names[0]}' document attribute"
end
end

if cmd_path.nil? && options.fetch(:raise_on_error, true)
raise "Could not find the #{cmd_names.map { |c| "'#{c}'" }.join(', ')} executable in PATH; add it to the PATH or specify its location using the '#{attr_names[0]}' document attribute"
end

cmd_path
Expand Down

0 comments on commit 004d85a

Please sign in to comment.