Skip to content

Commit

Permalink
feat(r-dependent-packages): new skip option to skip R package insta…
Browse files Browse the repository at this point in the history
…llation
  • Loading branch information
eitsupi committed Sep 11, 2024
1 parent 89e5e7e commit f2f9467
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/r-dependent-packages/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "R packages from the DESCRIPTION file (via pak)",
"id": "r-dependent-packages",
"version": "0.1.0",
"version": "0.2.0",
"description": "This Feature sets scripts to install dependent R packages from the DESCRIPTION file in the repository.",
"documentationURL": "https://github.com/rocker-org/devcontainer-features/tree/main/src/r-dependent-packages",
"options": {
Expand All @@ -11,9 +11,10 @@
"enum": [
"onCreate",
"updateContent",
"postCreate"
"postCreate",
"skip"
],
"description": "When to install the dependent R packages? Each option corresponds to the lifecycle scripts."
"description": "When to install the dependent R packages? Each option corresponds to the lifecycle scripts. 'skip' means to skip the installation."
},
"pakVersion": {
"type": "string",
Expand Down
12 changes: 12 additions & 0 deletions test/r-dependent-packages/r-ver-skip.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -e

# Optional: Import test library bundled with the devcontainer CLI
source dev-container-features-test-lib

# Feature-specific tests
check "R pak package" bash -c "R -q -e 'names(installed.packages()[, 3])' | grep pak"

# Report result
reportResults
8 changes: 8 additions & 0 deletions test/r-dependent-packages/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
}
}
},
"r-ver-skip": {
"image": "rocker/r-ver:4",
"features": {
"r-dependent-packages": {
"when": "skip"
}
}
},
"r-ver-updatecontent": {
"image": "rocker/r-ver:4",
"features": {
Expand Down

0 comments on commit f2f9467

Please sign in to comment.