Skip to content

use_namespace(roxygen=FALSE) creates an invalid NAMESPACE #1120

Description

@mtmorgan
usethis::create_package("foo", roxygen = FALSE)
devtools::install()

fails with

** building package indices
Error : '\.' is an unrecognized escape in character string starting ""^[^\."
ERROR: installing namespace metadata failed

because

write_over(path, 'exportPattern("^[^\\.]")')
creates a namespace with text

$ cat NAMESPACE
exportPattern("^[^\.]")

The escaped . needs to be \\\\.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions