Skip to content

Commit

Permalink
Use path /usr/local/bin/somedriver instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed Nov 17, 2023
1 parent 1572d90 commit 87dfe46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/gnu_x86_64_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
uses: actions/checkout@v2
- name: Install Chrome
uses: browser-actions/setup-chrome@latest
- name: Install Chrome driver.
uses: nanasess/setup-chromedriver@v2
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
- name: Install shards
Expand Down
8 changes: 4 additions & 4 deletions src/translater.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ class Translater
def create_driver(browser, debug_mode)
case browser
in Browser::Firefox
driver_path = File.expand_path("~/.webdrivers/geckodriver", home: true)
driver_path = "/usr/local/bin/geckodriver"
if !File.exists?(driver_path)
STDERR.puts "#{driver_path} not exists! Please install correct version selenium driver for Firefox manually before continue, exit ..."
STDERR.puts "#{driver_path} not exists! Please install correct version Selenium driver for Firefox manually before continue, exit ..."
exit
end
service = Selenium::Service.firefox(driver_path: driver_path)
Expand All @@ -18,9 +18,9 @@ class Translater
capabilities = Selenium::Firefox::Capabilities.new
capabilities.firefox_options = options
in Browser::Chrome
driver_path = File.expand_path("~/.webdrivers/chromedriver", home: true)
driver_path = "/usr/local/bin/chromedriver"
if !File.exists?(driver_path)
STDERR.puts "#{driver_path} not exists! Please install correct version selenium driver for Chrome manually before continue, exit ..."
STDERR.puts "#{driver_path} not exists! Please install correct version Selenium driver for Chrome manually before continue, exit ..."
exit
end
service = Selenium::Service.chrome(driver_path: driver_path)
Expand Down

0 comments on commit 87dfe46

Please sign in to comment.