Skip to content

Conversation

@jthurner
Copy link

Here is a proposal to fix r-lib/here#34 – appending to paths created by here():

If the first argument to the function produced by criterion$make_fix_file() starts with the saved root, base the path on the first argument instead of the saved root.

here()
> "/poject_root"
a <- here("one","two")
a
> "/poject_root/one/two"
here(a,"three")
> "/project_root/one/two/three"

This change shouldn't break existing code as the current implementation always produces invalid paths when nesting here().
Further nesting or using a path outside the project root still won't return anything useful, but I can't really think of how that would make sense in the context of the here() function.

It would fix the first part (safe_here) of the related r-lib/here#31 (comment).
The second part asks for optionally returning the path relative to the current working directory, as in r-lib/here#36, which sounds like a separate issue to me.

jthurner and others added 2 commits May 19, 2020 01:12
Calling the accessor returned by make_fix_file() with an absolute
path as first argument appends to the provided path instead of
to the root path if the provided path is inside the root path.
@jthurner
Copy link
Author

jthurner commented Nov 9, 2020

Obsolete with #59

@jthurner jthurner closed this Nov 9, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Append to a path created by here()

2 participants