diff --git a/.Rprofile b/.Rprofile index d059c2fcc5..6d46e67550 100644 --- a/.Rprofile +++ b/.Rprofile @@ -1,8 +1,7 @@ # Set renv profile base on R version. .get_dependencies <- function(project_dir) { - admdev_loc <- find.package("admiraldev", lib.loc = .libPaths(), quiet = TRUE) - adm_dev_suggests <- if(length(admdev_loc) != 0) { + adm_dev_suggests <- if (length(admdev_loc) != 0) { renv:::renv_dependencies_discover_description(admdev_loc, fields = c("Depends", "Imports", "LinkingTo", "Suggests")) } else { data.frame(Packages = character(0)) @@ -19,7 +18,7 @@ )) ) ) - packages[!(packages %in% c("admiral", "admiraldev", "admiralci", "admiral.test", "pharmaversesdtm", getwd()))] + packages[!(packages %in% c("admiral", "admiraldev", "admiralci", "pharmaversesdtm", getwd()))] } options(renv.snapshot.filter = .get_dependencies) diff --git a/.devcontainer/4.1/devcontainer.json b/.devcontainer/4.1/devcontainer.json index 1d05f7fdf1..ab6ddfeeae 100644 --- a/.devcontainer/4.1/devcontainer.json +++ b/.devcontainer/4.1/devcontainer.json @@ -31,7 +31,7 @@ "postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", - "postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"", + "postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"; echo 'To open rstudio in your browser, just type rstudio in the terminal'", "customizations": { "vscode": { diff --git a/.devcontainer/4.2/devcontainer.json b/.devcontainer/4.2/devcontainer.json index f30486e0d8..decbcca545 100644 --- a/.devcontainer/4.2/devcontainer.json +++ b/.devcontainer/4.2/devcontainer.json @@ -31,7 +31,7 @@ "postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", - "postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"", + "postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"; echo 'To open rstudio in your browser, just type rstudio in the terminal'", "customizations": { "vscode": { diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4f49db8fe5..3f47589f32 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -31,7 +31,7 @@ "postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", - "postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"", + "postAttachCommand": "$BROWSER \"https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}/\"; echo 'To open rstudio in your browser, just type rstudio in the terminal'", "customizations": { "vscode": { diff --git a/.devcontainer/postCreateCommand.sh b/.devcontainer/postCreateCommand.sh index 9b9db23af9..8dfe4e236e 100644 --- a/.devcontainer/postCreateCommand.sh +++ b/.devcontainer/postCreateCommand.sh @@ -1,5 +1,11 @@ #!/bin/bash +# move script rstudio into /usr/bin +sudo cp "$(pwd)/.devcontainer/rstudio.sh" /usr/bin/rstudio +sudo chmod +x /usr/bin/rstudio + +# Restore renv and install staged dependencies R -q -e 'renv::restore(lockfile = file.path("renv", "profiles", paste(R.version$major, substr(R.version$minor, 1, 1), sep = "."), "renv.lock")); staged.dependencies::install_deps(staged.dependencies::dependency_table(project = ".", verbose = 1), verbose = 1);' +# Define rstudio default working directory jq --arg folder "$(pwd)/" '. + { "initial_working_directory": $folder }' .devcontainer/rstudio-prefs.json > ~/.config/rstudio/rstudio-prefs.json diff --git a/.devcontainer/rstudio.sh b/.devcontainer/rstudio.sh new file mode 100644 index 0000000000..053a247b5b --- /dev/null +++ b/.devcontainer/rstudio.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +$BROWSER "https://${CODESPACE_NAME}-8787.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" + +exit 1 diff --git a/renv/profiles/4.1/renv/settings.json b/renv/profiles/4.1/renv/settings.json index 4922677e15..0c8943c5c8 100644 --- a/renv/profiles/4.1/renv/settings.json +++ b/renv/profiles/4.1/renv/settings.json @@ -4,7 +4,6 @@ "ignored.packages": [ "admiral", "admiraldev", - "admiral.test", "admiralci", "pharmaversesdtm" ], diff --git a/renv/profiles/4.2/renv/settings.json b/renv/profiles/4.2/renv/settings.json index 4922677e15..0c8943c5c8 100644 --- a/renv/profiles/4.2/renv/settings.json +++ b/renv/profiles/4.2/renv/settings.json @@ -4,7 +4,6 @@ "ignored.packages": [ "admiral", "admiraldev", - "admiral.test", "admiralci", "pharmaversesdtm" ], diff --git a/renv/profiles/4.3/renv/settings.json b/renv/profiles/4.3/renv/settings.json index 4922677e15..0c8943c5c8 100644 --- a/renv/profiles/4.3/renv/settings.json +++ b/renv/profiles/4.3/renv/settings.json @@ -4,7 +4,6 @@ "ignored.packages": [ "admiral", "admiraldev", - "admiral.test", "admiralci", "pharmaversesdtm" ], diff --git a/renv/settings.json b/renv/settings.json index 3462f3b093..0c8943c5c8 100644 --- a/renv/settings.json +++ b/renv/settings.json @@ -4,8 +4,8 @@ "ignored.packages": [ "admiral", "admiraldev", - "admiral.test", - "admiralci" + "admiralci", + "pharmaversesdtm" ], "package.dependency.fields": [ "Imports",