Open Diego-MX opened 4 months ago
Does startup::startup(all=TRUE)
provide what you need?
I don't understand the .gitignore part
Thank you for your answer. I'll write in three bullets:
.gitignore
. all=TRUE
, paths=c(...)
*\.(txt|md|~)
, *\.(Rhistory|RData|DS_Store)
or starting with \.\.*
are ignored. I'm thinking along the lines of ignoring .gitignore
as well. I'll make a case, with a -hopefully- simple example.
# ~/.Rprofile
print("My local functions, which other developers don't need or even use.")
print("May include fortunes:fortune(), or set local repository")
# my-proj/R-src/.Rprofile.d/0-local.R
source(~/.Rprofile)
print("I thought to call them here, since I set up my proj profile.")
# my-proj/R-src/.Rprofile.d/1-package.R
proj_function <- function(x) print("Project uses this function.")
# my-proj/R-src/.Rprofile.d/.gitignore
0-local.R
This last file throws an error as it is in .Rprofile.d
The workaround is to ignore 0-local.R
from an outer .gitignore
# my-proj/R-src/.gitignore
.Rprofile.d/0-local.R
This is very close to ideal, so happy to live with that.
Going back to the ideal solution, I didn't find how to make all=TRUE
help.
But partially found the following does: (using magrittr
pipes)
"my-proj/R-src/.Rprofile.d" %>%
list.files(all.files=TRUE, full.names=TRUE) %>%
str_subset("/\\.", negate=TRUE) %>% # Includes /.gitignore and others.
rprofile_d(paths=.)
I mean partially, because I can only call rprofile_d
like this, but not startup
.
So one final question, and one proposal:
i) Is there a parameter to ignore other files (like *.(txt|md|~)
?
ii) if you think the .gitignore
case is a strong one, I can look into the code and try a Pull Request.
Thank you =D
Disclaimer: I just recently started using your package. I find it really great, and I'm still getting the hang of it.
I have setup my local
~/.Rprofile.d
And then I added a project one.../my-project/.Rprofile.d
The project profile has:
0-local-profile.R
which handles what's found in~/.Rprofile.d
1-proj-profile.R
self contained profile.gitignore
to ignore the first0-local-profile.R
So the issue is that
startup()
cannot process.gitignore
because it is not an R-profile.And I have two questions:
startup()
to simply ignore.gitignore
?Thank you.