r-lib/pkgload

Export `shim_system.file` & `dev_packages`?

yogat3ch opened this issue · 2 comments

Hey pkgload devs,
We're using the golem framework for building shiny apps which makes it such that the location of files changes between our development environment and where they're found once the app is deployed as a package.
It would be super useful for us to be able to use shim_system.file and dev_packages in our functions that create directory paths such that all the file paths work in both scenarios. Could this be function be exported?

You can use fs::path_package() instead of system.file().

We don't recommend having a lot of branched code for dev and install paths. Why do you need dev_packages()? We already have is_dev_package() exported which can be occasionally useful.

Hi @lionel- ,
Thank you for the quick response! It does look like fs::path_package & is_dev_package in combination with pkgload::pkg_name will cover our needs. Thanks for pointing me in the right direction 🙏