extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
184 stars 27 forks source link

`pretty_rel_path()` should work outside of a package #79

Closed yutannihilation closed 3 years ago

yutannihilation commented 3 years ago

(Originally found here: https://github.com/extendr/extendr/pull/190#issuecomment-798998867)

Currently it assumes the package root can be found, but I guess it might not be available in the case of rust_source().

https://github.com/extendr/rextendr/blob/74817048d578c640e77df740e1fa00071320a011/R/track_rust_source.R#L5-L7

clauswilke commented 3 years ago

The benefit of integration testing. I've added this to #68.

clauswilke commented 3 years ago

Since pretty_rel_path is only used for printing, it should simply return the original path if no package can be found. @Ilia-Kosenkov should be able to add this in #76.

yutannihilation commented 3 years ago

Sounds good.

Ilia-Kosenkov commented 3 years ago

See https://github.com/extendr/rextendr/issues/83#issuecomment-799689776

clauswilke commented 3 years ago

@Ilia-Kosenkov If you consider this issue addressed with #76, please go ahead and close.

clauswilke commented 3 years ago

This seems to work now.