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 18f072a
Showing 1 changed file with 4 additions and 3 deletions.
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 18f072a

Please sign in to comment.