Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Don't set options if webR or Emscripten not found
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Oct 24, 2023
1 parent 99ac59d commit 01ef41d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ Suggests:
knitr,
rmarkdown
VignetteBuilder: knitr
URL: https://r-wasm.github.io/webr-repo/
Config/Needs/website: tidyverse/tidytemplate
10 changes: 6 additions & 4 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ find_emscripten <- function() {
.onLoad <- function(libname, pkgname) {
webr_root <- find_webr()
emscripten_root <- find_emscripten()
webr_version <- readLines(fs::path(webr_root, "R", "R-VERSION"))
options(rwasm.webr_root = webr_root)
options(rwasm.webr_version = webr_version)
options(rwasm.emscripten_root = emscripten_root)
if (!is.null(webr_root) && !is.null(emscripten_root)) {
webr_version <- readLines(fs::path(webr_root, "R", "R-VERSION"))
options(rwasm.webr_root = webr_root)
options(rwasm.webr_version = webr_version)
options(rwasm.emscripten_root = emscripten_root)
}
}

.onAttach <- function(libname, pkgname) {
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url: ~
url: https://r-wasm.github.io/webr-repo/
template:
bootstrap: 5

0 comments on commit 01ef41d

Please sign in to comment.