Skip to content

Commit

Permalink
Fix chromedriver.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbythorpe committed Oct 25, 2023
1 parent 45b0c5c commit 4fdb9e7
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export(iedriver)
export(phantomjs)
export(predl_chrome_for_testing)
export(selenium)
export(unziptar_dlfiles)
export(unziptar_chromedriver)
importFrom(assertthat,assert_that)
importFrom(binman,app_dir)
importFrom(binman,assign_directory)
Expand Down
25 changes: 14 additions & 11 deletions R/predl_chrome_for_testing.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,31 +36,34 @@ predl_chrome_for_testing <- function(url, platform, history,
}
}
extracted <- do.call(rbind, lapply(ver_data, unwrap))
print(extracted)
app_links <- tapply(extracted, extracted$platform, identity)
has_platform <- vapply(
names(app_links),
function(x) any(grepl(platformregex, x, perl = TRUE)),
FUN.VALUE = logical(1)
)
app_links <- app_links[has_platform]
print(names(app_links))
print(platform)
app_links <- app_links[platform]
print(app_links)
assign_directory(app_links, appname)
}

#' Unzip/untar files
#' Unzip/untar the chromedriver file
#'
#' Unzip or untar downloaded files
#' Unzip or untar a downloaded chromedriver file, then extract it from
#' its folder.
#'
#' @param ... Passed into [binman::unziptar_dlfiles].
#'
#' @return The same as [binman::unziptar_dlfiles].
#'
#' @export
unziptar_dlfiles <- function(...) {
unziptar_chromedriver <- function(...) {
chmod <- list(...)$chmod
x <- binman::unziptar_dlfiles(...)
for (f in x$processed) {
dir <- tools::file_path_sans_ext(f)
file.copy(list.files(dir, full.names = TRUE), dirname(dir))
file.copy(list.files(dir, full.names = TRUE), dirname(dir), copy.mode = TRUE)

if (chmod && .Platform$OS.type != "windows") {
Sys.chmod(list.files(dirname(dir), pattern = "^chromedriver$", full.names = TRUE), "0755")
}
}
x
}
8 changes: 4 additions & 4 deletions inst/yaml/chromedriver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ predlfunction:
"wdman::predl_chrome_for_testing":
url: https://googlechromelabs.github.io/chrome-for-testing/latest-versions-per-milestone-with-downloads.json
platform:
- mac64_m1
- mac64
- linux32
- mac-arm64
- mac-x64
- linux64
- win32
- win64
history: 3
appname: "chromedriver"
dlfunction:
"binman::download_files": []
postdlfunction:
"wdman::unziptar_dlfiles":
"wdman::unziptar_chromedriver":
chmod: TRUE
11 changes: 6 additions & 5 deletions man/unziptar_dlfiles.Rd → man/unziptar_chromedriver.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4fdb9e7

Please sign in to comment.