Skip to content

Commit

Permalink
Use protable api for find_executable
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Apr 11, 2024
1 parent 7fe59ba commit aa05d11
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/translater.cr
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,11 @@ class Translater
end

if driver_path.nil?
driver_parent_path = ENV["PATH"].split(':').find do |p|
File.executable?(File.join(p, "geckodriver"))
end
driver_path = Process.find_executable(driver_binary)

if driver_parent_path.nil?
if driver_path.nil?
abort "Selenium driver couldn't found on the path!
try install it into #{driver_paths.join(" or ")} before continue, exit ..."
else
driver_path = File.join(driver_parent_path, "geckodriver")
end
end

Expand Down

0 comments on commit aa05d11

Please sign in to comment.