devtools (version 1.0)

run_onload: Run .onLoad if needed

Description

This is run before copying objects from the namespace to the package environment. In a normal install + load, the namespace would be locked between these stages, but we don't do that with load_all.

Usage

run_onload(pkg = ".")

Arguments

pkg
package description, can be path or package name. See as.package for more information

Details

A variable called onLoad is created in the package's devtools metdata to indicate that it's attached.

When a package is loaded with library() it calls .onLoad(libpath, pkg), where libpath is the library path for package, and pkg is the name of the package. Because in-development packages are not installed to a library, this function can't call .onLoad with a proper libpath, so it uses NULL instead.