-
Notifications
You must be signed in to change notification settings - Fork 22
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
Work with absolute paths #41
base: main
Are you sure you want to change the base?
Conversation
R/downlit-md.R
Outdated
@@ -30,6 +30,9 @@ downlit_md_path <- function(in_path, out_path, format = NULL) { | |||
ast_path <- tempfile() | |||
on.exit(unlink(ast_path)) | |||
|
|||
in_path <- fs::path_abs(in_path) |
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.
Is there a reason not to use normalizePath()
here? I'd prefer to keep the dependencies lighter.
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.
The file must exist, this is generally not true for out_path
:
normalizePath("bogus")
#> Warning in normalizePath("bogus"): path[1]="bogus": No such file or directory
#> [1] "bogus"
Created on 2020-09-03 by the reprex package (v0.3.0)
Same with mustWork = FALSE
sans warning.
We can work around if you think it's worth it, or copy code from fs.
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.
I guess the other option is to require/document that the user supply absolute paths? That might be easier given that I expect relatively few people to be calling this function.
Works now. Do we need a test? |
Yeah, a test would be useful I think. |
Done. |
3206600
to
30a9ab7
Compare
Resolved conflicts. |
I bumped into this issue today and, although rstudio/rmarkdown#1889 has been closed, I suspect it is not truly fixed. Anecdotally, it feels like I am having trouble using |
Work around rstudio/rmarkdown#1889.