If load_all() doesn't find a DESCRIPTION file in the package directory, it is created. As of #803, parent directories will not be scanned for a DESCRIPTION file. #816 explicitly documents and tests this behavior.
Now the behavior of load_all() is difficult to understand and communicate: If a directory happens to contain R, src or data, a DESCRIPTION is created -- if not (and no DESCRIPTION exists), an error is thrown:
> pkg <- tempfile(); dir.create(pkg); devtools::load_all(pkg)
Error: '/tmp/RtmpqMuf1p/file498b5f0c4c48' does not look like a package: no R/, src/ or data directories
No traceback available
> pkg <- tempfile(); dir.create(pkg); dir.create(file.path(pkg, "R")); devtools::load_all(pkg)
No DESCRIPTION found. Creating with values:
I suggest a new argument create_if_missing that governs this behavior. If TRUE, always create (perhaps via devtools::setup()). If FALSE, never create (but use the usual pkg <- as.package(pkg) idiom). If NULL (the default), the user will be asked if in interactive mode (otherwise same as FALSE).
@hadley: Is this sufficient for the use case you described in your comment?
If
load_all()doesn't find aDESCRIPTIONfile in the package directory, it is created. As of #803, parent directories will not be scanned for aDESCRIPTIONfile. #816 explicitly documents and tests this behavior.Now the behavior of
load_all()is difficult to understand and communicate: If a directory happens to containR,srcordata, aDESCRIPTIONis created -- if not (and noDESCRIPTIONexists), an error is thrown:I suggest a new argument
create_if_missingthat governs this behavior. IfTRUE, always create (perhaps viadevtools::setup()). IfFALSE, never create (but use the usualpkg <- as.package(pkg)idiom). IfNULL(the default), the user will be asked if in interactive mode (otherwise same asFALSE).@hadley: Is this sufficient for the use case you described in your comment?