Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

option to have .here file override any other heuristics #21

Closed
swayson opened this issue May 22, 2018 · 9 comments · Fixed by #55
Closed

option to have .here file override any other heuristics #21

swayson opened this issue May 22, 2018 · 9 comments · Fixed by #55

Comments

@swayson
Copy link

swayson commented May 22, 2018

Some of the users with whom I collaborate with have complicated folder structures. We use .git for version control, some use RStudio and so the .rproj etc. can often result in the heuristics playing out in a inconsistent way.

An option to have the .here file override any other heuristics would be a great way to solve this.

Is this possible?

@swayson
Copy link
Author

swayson commented Aug 22, 2018

+1

1 similar comment
@pwjvr
Copy link

pwjvr commented Aug 22, 2018

+1

@krlmlr
Copy link
Member

krlmlr commented Aug 22, 2018

Sounds reasonable to me to do this unconditionally, but could this break other users' workflows?

@adityabandla
Copy link

I am having the same issue. I typically track only my R scripts (using git) which reside in a folder under the root directory. When running R scripts from this folder, here seems to stop one it detects the .git and ignore the .here file in the parent folder

@ashander
Copy link

ashander commented Jul 5, 2019

I ran into something similar when and took the advice in ?here() to use more granular functions provided by rprojroot

This package is intended for interactive use only.
Use [rprojroot::has_file()] or the other functions in
the \pkg{rprojroot} package for more control,
or for package development.

@krlmlr
Copy link
Member

krlmlr commented Nov 12, 2020

Thanks. I'm reluctant to change the default criteria at this stage, using rprojroot looks like a good solution in those situations.

@krlmlr
Copy link
Member

krlmlr commented Nov 12, 2020

I added a link to the "Getting started" article, feedback welcome.

@D3SL
Copy link

D3SL commented Jul 18, 2021

Thanks. I'm reluctant to change the default criteria at this stage, using rprojroot looks like a good solution in those situations.

I might have been running into an edge case caused by something else but I thought obeying the .here file was the default criteria. I don't know when that changed, or if this was never the intended behavior and I was just unreasonably lucky for a year and a half, but now this package is essentially unusable for me when making and testing dockerized shiny apps.

The problem is that the project includes a parent folder full of docker build files and such that aren't copied over when the final image is built. Only the subfolder containing the app and all of its files and scripts gets copied over.

As an example:

.
├── my_project1    //project root during development
         ├── .dockerignore
         ├── container_name.Rproj
         ├──  Dockerfile
         └── my_project2   //only this folder is copied to the docker image
                  ├── ui.r
                  ├── server.r
                  ├── global.r
                  ├── .here
                  └── data
                             └── data.csv

The project itself begins with my_project1, but when the docker image is built only my_project2 will be copied over. here() allowed me to place a .here file in my_project2 and make all of my code completely directory structure agnostic. Now I need to change every line of code back and forth between here("my_project1", "data") when developingand here("data") when building the final docker image, or abandon keeping all of the docker files as part of version control/project management.

To me this seems a lot more counterintuitive than the idea of ".here and it Just Works", and basically cripples the package for anyone who doesn't fit exactly into the RStudio proprietary way of doing things. I've taken a look at rprojroot and it seems like a very excessive approach for something this simple, and one that still seems predicated on doing things only one exact way.

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 19, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants