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.
Value
the source packages as a "scrpkgs" object, cf find_srcpkgs()
, or NULL if none
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
Examples
pkgs <- get_srcpkgs()
print(pkgs)
#> package version path
#> srcpkgs srcpkgs 0.1.1 /home/runner/work/srcpkgs/srcpkgs
#> imports depends
#> srcpkgs cli,\ndevtools,\npkgload
#> suggests
#> srcpkgs knitr,\nrmarkdown,\ntestthat (>= 3.0.0),\nwithr