-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
* Improved write_greta_install_log()
and read_greta_install_log()
#712
* Improved write_greta_install_log()
and read_greta_install_log()
#712
Conversation
… to use `tools::R_user_dir()` to always write to a file location. `read_greta_install_log()` will open one found from an environment variable or go to the default location. (greta-dev#703)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so neat 😸
R/install_greta_deps.R
Outdated
#' not specified the `GRETA_INSTALLATION_LOG` environmental variable, the | ||
#' installation notes will indicate how to use [write_greta_install_log()]. | ||
#' `greta_set_install_logfile('path/to/logfile.html')`. By default it uses | ||
#' `tools::R_user_dir("greta")`. To see installation notes or errors, after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tools::R_user_dir("greta")
is a folder so what's the file path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
R/install_greta_deps.R
Outdated
greta_default_logfile <- function(){ | ||
greta_user_dir <- get_pkg_user_dir() | ||
default_greta_logfile_path <- glue::glue( | ||
"{greta_user_dir}/greta-installation-logfile.html" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not file.path(greta_user_dir, "greta-installation-logfile.html")
? I once read one should not paste to create a path but I can't remember why (the slash difference on OS? something else?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I'm in a habit using glue for everything.
…cifying not just a directory
Use
tools::R_user_dir()
to always write to a file location.read_greta_install_log()
will open one found from an environment variable or go to the default location. (#703)Thanks @maelle for this excellent suggestion!