File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# !/usr/bin/env Rscript
2+
23if (! requireNamespace(" devtools" , quietly = TRUE )) {
34 stop(" Please install devtools first: install.packages('devtools')" )
45}
@@ -28,15 +29,15 @@ author_name <- read_from_terminal("Author name: ")
2829author_email <- read_from_terminal(" Author email: " )
2930pkg_description <- read_from_terminal(" Package description (a few sentences): " )
3031
31- # Create package directory
32- pkg_path <- file.path(getwd(), pkg_name )
33- cat(" Creating package at:" , pkg_path , " \n " )
34-
3532# Ensure we have a valid package name
3633if (nchar(trimws(pkg_name )) == 0 ) {
3734 stop(" Package name cannot be empty" )
3835}
3936
37+ # Create package in a new subdirectory
38+ pkg_path <- normalizePath(file.path(getwd(), pkg_name ), mustWork = FALSE )
39+ cat(" Creating package at:" , pkg_path , " \n " )
40+
4041usethis :: create_package(pkg_path , open = FALSE )
4142setwd(pkg_path )
4243
You can’t perform that action at this time.
0 commit comments