Skip to content

here does not appear to find the package directory when run from inside the tests folder #49

@yogat3ch

Description

@yogat3ch

I am encountering issues with here::here() not being able to find the root directory of a package when it's called from inside the tests/testthat folder.
I have a .here file, a DESCRIPTION file, and an Rproj file two levels up from the tests/testthat as one might expect, but dr_here indicates the following:

- contains a file `.here`
- contains a file matching `[.]Rproj$` with contents matching `^Version: ` in the first line
- contains a file `DESCRIPTION` with contents matching `^Package: `
- contains a file `remake.yml`
- contains a file `.projectile`
- contains a directory `.git`
- contains a file `.git` with contents matching `^gitdir: `
- contains a directory `.svn`

It seems like it's not traversing up the tree to the proper parents given this output.
The following does work to find the root directory however:

rprojroot::find_root_file(criterion = rprojroot::has_file("DESCRIPTION"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions