HenrikBengtsson / startup

:wrench: R package: startup - Friendly R Startup Configuration
https://henrikbengtsson.github.io/startup/
163 stars 5 forks source link

WISH: Flag and/or environment variable to declare script requires internet access #123

Open HenrikBengtsson opened 2 years ago

HenrikBengtsson commented 2 years ago

Issue

The default assumption is that R has access to the internet. For example, during startup, we might call foghorn to query the CRAN status of R packages we maintain. However, if there is no internet access (e.g. when being off the grid or running in airplane), such calls will fail - often with a long timeout period first.

Suggestion

Add a mechanism to skip startup scripts when there's no internet access. One idea is to introduce an environment variable NO_INTERNET to be used in file names as:

~/.Rprofile.d/interactive=TRUE/when=daily/package=foghorn,NO_INTERNET!=TRUE.R

This file will be skipped if, and only if:

It will be processed if:

Comment: It would be better if we could detect if an environment variable is defined or not, cf. Issue #89.