File tree Expand file tree Collapse file tree 5 files changed +28
-5
lines changed
test/r-dependent-packages Expand file tree Collapse file tree 5 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " R packages from the DESCRIPTION file (via pak)" ,
33 "id" : " r-dependent-packages" ,
4- "version" : " 0.1 .0" ,
4+ "version" : " 0.2 .0" ,
55 "description" : " This Feature sets scripts to install dependent R packages from the DESCRIPTION file in the repository." ,
66 "documentationURL" : " https://github.com/rocker-org/devcontainer-features/tree/main/src/r-dependent-packages" ,
77 "options" : {
1111 "enum" : [
1212 " onCreate" ,
1313 " updateContent" ,
14- " postCreate"
14+ " postCreate" ,
15+ " skip"
1516 ],
16- "description" : " When to install the dependent R packages? Each option corresponds to the lifecycle scripts."
17+ "description" : " When to install the dependent R packages? Each option corresponds to the lifecycle scripts. 'skip' means to skip the installation. "
1718 },
1819 "pakVersion" : {
1920 "type" : " string" ,
Original file line number Diff line number Diff line change @@ -78,10 +78,11 @@ install_pak "${PAK_VERSION}"
7878
7979# Replace the target lifecycle script
8080echo " Set the lifecycle script for '${WHEN} '..."
81+ LIFECYCLE_SCRIPT_PATH=" ${LIFECYCLE_SCRIPTS_DIR} /${WHEN,,} .sh"
8182sed \
8283 -e " s|@ROOT@|${ROOT} |" \
8384 -e " s|@REPOS@|${REPOS// " '" / ' "' } |" \
8485 -e " s|@DEPS@|${DEPS} |" \
85- lifecycle_script.sh > " ${LIFECYCLE_SCRIPTS_DIR} / ${WHEN,,} .sh "
86-
86+ lifecycle_script.sh > " ${LIFECYCLE_SCRIPT_PATH} "
87+ echo " The lifecycle script is generated at ' ${LIFECYCLE_SCRIPT_PATH} ' "
8788echo " Done!"
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ fix_permissions() {
1919
2020fix_permissions " ${PKG_PACKAGE_CACHE_DIR} "
2121
22+ echo " The manifest DESCRIPTION file was set to '@ROOT@/DESCRIPTION'"
2223echo " Install dependent R packages..."
2324
2425R -q -e \
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -e
4+
5+ # Optional: Import test library bundled with the devcontainer CLI
6+ source dev-container-features-test-lib
7+
8+ # Feature-specific tests
9+ check " R pak package" bash -c " R -q -e 'names(installed.packages()[, 3])' | grep pak"
10+
11+ # Report result
12+ reportResults
Original file line number Diff line number Diff line change 1616 }
1717 }
1818 },
19+ "r-ver-skip" : {
20+ "image" : " rocker/r-ver:4" ,
21+ "features" : {
22+ "r-dependent-packages" : {
23+ "when" : " skip"
24+ }
25+ }
26+ },
1927 "r-ver-updatecontent" : {
2028 "image" : " rocker/r-ver:4" ,
2129 "features" : {
You can’t perform that action at this time.
0 commit comments