keep version in gecko

This commit is contained in:
Mylloon 2023-05-13 10:22:36 +02:00
parent 349952d116
commit 76675b179a
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 4 additions and 2 deletions

2
.gitignore vendored
View file

@ -2,4 +2,4 @@ _build/
/selenium-*.jar
/gecko-*.tar.gz
/geckodriver
/geckodriver-*

View file

@ -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
;;