From 76675b179a3b8b18eaf71d7f1b3c1c4a88e9fe29 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 13 May 2023 10:22:36 +0200 Subject: [PATCH] keep version in gecko --- .gitignore | 2 +- lib/drivers.ml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 28024af..e20c59f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ _build/ /selenium-*.jar /gecko-*.tar.gz -/geckodriver +/geckodriver-* diff --git a/lib/drivers.ml b/lib/drivers.ml index 1919576..918fafc 100644 --- a/lib/drivers.ml +++ b/lib/drivers.ml @@ -57,13 +57,15 @@ type driver = Gecko of string let prepare = function | Gecko version_driver -> - let driver = "geckodriver" in + let driver = fmt "geckodriver-%s" version_driver in if not (Sys.file_exists driver) then ( let archive = fmt "./gecko-%s.tar.gz" version_driver in Lwt_main.run (download_gecko_driver version_driver archive); (* TODO: Use native version instead of relying on Unix tools *) let _ = Sys.command (fmt "tar xvzf %s" archive) in + let _ = Sys.command (fmt "mv geckodriver %s" driver) in + let _ = Sys.command (fmt "rm %s" archive) in ()); driver ;;