The first call to this function will trigger the initialization of the package ((cf reset()).
Since it is used by mostly all user-facing load-related functions, this enables a runtime initialization,
as opposed to a load-time initialization. So for example
you may load srcpkgs, then change the current directory to your project.
Then the first load will setup the settings.
Usage
get_srcpkgs(filter = NULL)
Value
the source packages as a "scrpkgs" object, cf find_srcpkgs(), or NULL if none
Arguments
filter
a pattern to filter the source packages
Details
For optimization, the paths to discovered source packages are cached (cf reset() and settings().
This function will reparse the DESCRIPTION for any change.
If you add or delete a source package, you must reset the source package paths using reset()
This function is useful for troubleshooting, to understand what are the source packages discovered
and managed by srcpkgs
# setup a srcpkg. We need reset because it is not discoverable from the current directorypkg <- setup_and_get_dummy_srcpkg()
reset(dirname(pkg$path))
print(get_srcpkgs())