From 87b8e20cb137652a548d0b78c21f37438259838d Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Thu, 16 Nov 2023 15:37:00 +0100 Subject: [PATCH 1/5] [r-packages] allow whitespace --- src/r-packages/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r-packages/install.sh b/src/r-packages/install.sh index b07601d..8b29892 100755 --- a/src/r-packages/install.sh +++ b/src/r-packages/install.sh @@ -92,7 +92,7 @@ install_r_packages() { fi fi - su "${USERNAME}" -c "R -q -e \"pak::repo_add(${ADDITIONAL_REPOSITORIES}); pak::pak(unlist(strsplit('${packages}', ','))); pak::cache_clean()\"" + su "${USERNAME}" -c "R -q -e \"pak::repo_add(${ADDITIONAL_REPOSITORIES}); pak::pak(trimws(unlist(strsplit('${packages}', ',')))); pak::cache_clean()\"" if [ "${is_apt}" = "true" ]; then # Clean up From 060f098c68092a0eb77387ba699e1090721df1a4 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Thu, 16 Nov 2023 19:53:01 +0100 Subject: [PATCH 2/5] add install-cli-rlan-ws test --- test/r-packages/install-cli-rlang-ws.sh | 13 +++++++++++++ test/r-packages/scenarios.json | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/r-packages/install-cli-rlang-ws.sh diff --git a/test/r-packages/install-cli-rlang-ws.sh b/test/r-packages/install-cli-rlang-ws.sh new file mode 100644 index 0000000..999e609 --- /dev/null +++ b/test/r-packages/install-cli-rlang-ws.sh @@ -0,0 +1,13 @@ +#!/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 cli package" R -q -e 'names(installed.packages()[, 3])' | grep cli +check "R rlang package" R -q -e 'names(installed.packages()[, 3])' | grep rlang + +# Report result +reportResults diff --git a/test/r-packages/scenarios.json b/test/r-packages/scenarios.json index bc79ea8..47d2fc2 100644 --- a/test/r-packages/scenarios.json +++ b/test/r-packages/scenarios.json @@ -7,6 +7,14 @@ } } }, + "install-cli-rlang-ws": { + "image": "rocker/r-ver:4", + "features": { + "r-packages": { + "packages": "cli, rlang" + } + } + }, "install-from-github": { "image": "rocker/r-ver:4", "features": { From 5e816ffbecbf52a5bc1b0a1c9c9b2796fb2ef212 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Thu, 16 Nov 2023 19:55:12 +0100 Subject: [PATCH 3/5] bump minor version --- src/r-packages/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r-packages/devcontainer-feature.json b/src/r-packages/devcontainer-feature.json index ecd6e21..fec2f5e 100644 --- a/src/r-packages/devcontainer-feature.json +++ b/src/r-packages/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "R packages (via pak)", "id": "r-packages", - "version": "1.0.3", + "version": "1.1.3", "description": "Installs R packages via the pak R package's function. R must be already installed.", "documentationURL": "https://github.com/rocker-org/devcontainer-features/tree/main/src/r-packages", "options": { From b65d1d82e27d84dc1430a97933f48b0fcfd0afd4 Mon Sep 17 00:00:00 2001 From: Daniel Possenriede Date: Thu, 16 Nov 2023 20:01:22 +0100 Subject: [PATCH 4/5] add install-curl-nano-wget-ws test --- test/apt-packages/install-curl-nano-wget-ws.sh | 14 ++++++++++++++ test/apt-packages/scenarios.json | 8 ++++++++ 2 files changed, 22 insertions(+) create mode 100644 test/apt-packages/install-curl-nano-wget-ws.sh diff --git a/test/apt-packages/install-curl-nano-wget-ws.sh b/test/apt-packages/install-curl-nano-wget-ws.sh new file mode 100644 index 0000000..207281d --- /dev/null +++ b/test/apt-packages/install-curl-nano-wget-ws.sh @@ -0,0 +1,14 @@ +#!/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 "curl" curl --version +check "nano" nano --version +check "wget" wget --version + +# Report result +reportResults diff --git a/test/apt-packages/scenarios.json b/test/apt-packages/scenarios.json index 9f8524f..3d36fe8 100644 --- a/test/apt-packages/scenarios.json +++ b/test/apt-packages/scenarios.json @@ -7,6 +7,14 @@ } } }, + "install-curl-nano-wget-ws": { + "image": "debian:stable-slim", + "features": { + "apt-packages": { + "packages": "curl, nano, wget" + } + } + }, "only-upgrade": { "image": "debian:stable-slim", "features": { From 8714df55edc806ae1791a41c5ca8d188ad4d074e Mon Sep 17 00:00:00 2001 From: eitsupi <50911393+eitsupi@users.noreply.github.com> Date: Fri, 17 Nov 2023 07:46:20 +0900 Subject: [PATCH 5/5] chore: fix version --- src/r-packages/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r-packages/devcontainer-feature.json b/src/r-packages/devcontainer-feature.json index fec2f5e..7d0f341 100644 --- a/src/r-packages/devcontainer-feature.json +++ b/src/r-packages/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "R packages (via pak)", "id": "r-packages", - "version": "1.1.3", + "version": "1.0.4", "description": "Installs R packages via the pak R package's function. R must be already installed.", "documentationURL": "https://github.com/rocker-org/devcontainer-features/tree/main/src/r-packages", "options": {