Skip to content

Commit

Permalink
WIP: Use installed pak
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed May 7, 2024
1 parent 11c1ddc commit 7fb7d44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build-rwasm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
3 changes: 1 addition & 2 deletions build-rwasm/code.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7fb7d44

Please sign in to comment.