-
Notifications
You must be signed in to change notification settings - Fork 13
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
Run rix_init after rix #231
Conversation
we could also add this: #230 (comment) EDIT: done |
ready for review
|
@b-rodrigues i have to think about it and sleep over it. We really should recommend users to make use of |
todos like discussed on matrix :-)
|
…age (one for testing)
Implemented, but with a twist: "verbose" is too chatty when rix_init() is called by rix(), so if the user chooses "verbose", it gets "downgraded" to "simple". |
That doesn't make sense to me. If I choose"verbose", I explicitly want "verbose", and consistent behavior across all functions, here |
The issue is that "verbose" for rix_init() prints many lines that push the lines from rix() out of the console. So my thinking was that if I'm using "verbose" with rix(), I'm more interested to what rix() has to say. I feel like then having rix_init() message_type set to "simple" would be enough for "verbose" for rix(). But if I'm calling rix_init() directly with "verbose", then yeah, I'd like to know everything rix_init() has to tell me. |
@b-rodrigues currently, we still don't get the expected behavior if we already have an |
Right, we need to check for existence of an already existing .Rprofile!
|
how do you know its generated?
rix::rix() does two things and I would want to exactly know what it does. I see two options, either we delete
Why don't we add a |
I check for the sentence "File generated by rix_init" and don't show the warning if it is found.
we could, but I think that simply providing a default that works largely 95% of the time with a warning in the rare cases it doesn't could be enough? |
> rix(
+ r_ver = "latest",
+ r_pkgs = c("dplyr", "ggplot2"),
+ system_pkgs = NULL,
+ git_pkgs = NULL,
+ local_pkgs = NULL,
+ ide = "code",
+ project_path = "_test",
+ overwrite = TRUE,
+ print = FALSE,
+ message_type = "quiet",
+ shell_hook = NULL
+ )
Warning message:
In rix(r_ver = "latest", r_pkgs = c("dplyr", "ggplot2"), system_pkgs = NULL, :
### .Rprofile file already exists. You may want to call rix_init(profile_action = 'append') manually to ensure correct functioning of your Nix environment. ### |
|
should we keep this warning, even if quiet ? That message only appears if .Rprofile already exists and wasn't created by rix_init, so it would appear very rarely and I'd say in these cases the users would like to be informed. What do you think ? |
yeah, you have a good point. Let's keep it like this. Technically it's a warning and it is good to inform at least, while Something that just came to my mind: If there is no problem, I would expect that It would nice to have something like this implemented before we merge; currently, there is none: > devtools::load_all(".")
ℹ Loading rix
> rix(
+ r_ver = "latest",
+ r_pkgs = c("dplyr", "ggplot2"),
+ system_pkgs = NULL,
+ git_pkgs = NULL,
+ local_pkgs = NULL,
+ ide = "code",
+ project_path = "_test",
+ overwrite = TRUE,
+ print = FALSE,
+ message_type = "simple",
+ shell_hook = NULL
+ ) |
"simple", message_type)) | ||
|
||
if(message_type != "quiet"){ | ||
message("\n\n### Successfully generated `default.nix` and `.Rprofile` ###\n\n") |
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.
Regarding your comment bout a successful run, wouldn't this be it ?
proposition, after 31399a9 we have > rix(
+ r_ver = "latest",
+ r_pkgs = NULL,
+ system_pkgs = NULL,
+ git_pkgs = NULL,
+ local_pkgs = NULL,
+ tex_pkgs = NULL,
+ ide = c("other", "code", "radian", "rstudio", "rserver"),
+ project_path = ".",
+ overwrite = TRUE,
+ print = FALSE,
+ message_type = "simple",
+ shell_hook = NULL
+ )
### Successfully generated `default.nix`. Keeping `.Rprofile` generated by `rix::rix_init()`### |
This PR would run rix_init each time rix is executed