From 7fb7d448eed610495b4141c762aa82b9c5da617d Mon Sep 17 00:00:00 2001 From: George Stagg Date: Tue, 7 May 2024 09:19:16 +0100 Subject: [PATCH] WIP: Use installed pak --- build-rwasm/Dockerfile | 2 ++ build-rwasm/code.R | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build-rwasm/Dockerfile b/build-rwasm/Dockerfile index ab6c7be..fb7620a 100644 --- a/build-rwasm/Dockerfile +++ b/build-rwasm/Dockerfile @@ -6,6 +6,8 @@ FROM $WEBR_IMAGE # Copies your code file from your action repository to the filesystem path `/` of the container COPY code.R /code.R +RUN Rscript -e 'pak::pak("zip")' + # Code file to execute when the docker container starts up (`entrypoint.sh`) ENTRYPOINT [ "Rscript" ] # ENTRYPOINT [ "/bin/bash", "-l", "-c" ] diff --git a/build-rwasm/code.R b/build-rwasm/code.R index 510b70f..07d61be 100644 --- a/build-rwasm/code.R +++ b/build-rwasm/code.R @@ -31,8 +31,7 @@ if (is.character(strip) && length(strip) == 1 && strip == "NULL") strip <- NULL cat("\nArgs:\n") str(list(image_path = image_path, repo_path = repo_path, packages = packages, strip = strip)) -if (!require("pak", character.only = TRUE, quietly = TRUE)) install.packages("pak") -if (!require("withr", character.only = TRUE, quietly = TRUE)) install.packages("withr") +if (!require("withr", character.only = TRUE, quietly = TRUE)) pak::pak("withr") # Work in the GHA directory so that package reference 'local::.' works as expected withr::local_dir(gha_dir)