@@ -26,8 +26,10 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
2626 maintainer = if (missing(author )) " Who to complain to"
2727 else author ,
282829- license = " What Licence is it under ? " ) {
29+ license = " GPL (>= 2) " ) {
3030
31+ havePkgKitten <- require(" pkgKitten" , quietly = TRUE , character.only = TRUE )
32+
3133 call <- match.call()
3234 call [[1 ]] <- as.name(" package.skeleton" )
3335 env <- parent.frame(1 )
@@ -117,17 +119,21 @@ Rcpp.package.skeleton <- function(name = "anRpackage", list = character(),
117119 close( ns )
118120
119121 # # update the package description help page
120- package_help_page <- file.path(root , " man" , sprintf( " %s-package.Rd" , name ))
121- if (file.exists(package_help_page )) {
122- lines <- readLines(package_help_page )
123- lines <- gsub(" What license is it under?" , license , lines , fixed = TRUE )
124- lines <- gsub(
" Who to complain to <[email protected] >" ,
125- sprintf( " %s <%s>" , maintainer , email ),
126- lines , fixed = TRUE )
127- lines <- gsub( " Who wrote it" , author , lines , fixed = TRUE )
128- writeLines(lines , package_help_page )
129- }
130-
122+ if (havePkgKitten ) { # if pkgKitten is available, use it
123+ pkgKitten :: playWithPerPackageHelpPage(name , path , maintainer , email )
124+ } else {
125+ package_help_page <- file.path(root , " man" , sprintf( " %s-package.Rd" , name ))
126+ if (file.exists(package_help_page )) {
127+ lines <- readLines(package_help_page )
128+ lines <- gsub(" What license is it under?" , license , lines , fixed = TRUE )
129+ lines <- gsub(
" Who to complain to <[email protected] >" ,
130+ sprintf( " %s <%s>" , maintainer , email ),
131+ lines , fixed = TRUE )
132+ lines <- gsub( " Who wrote it" , author , lines , fixed = TRUE )
133+ writeLines(lines , package_help_page )
134+ }
135+ }
136+
131137 # # lay things out in the src directory
132138 src <- file.path(root , " src" )
133139 if (! file.exists(src )) {
0 commit comments