Skip to content

Commit d2c47a2

Browse files
committed
skinnyagain
1 parent 2a2442c commit d2c47a2

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

skinnySkeleton.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env Rscript
2+
23
if (!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: ")
2829
author_email <- read_from_terminal("Author email: ")
2930
pkg_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
3633
if (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+
4041
usethis::create_package(pkg_path, open = FALSE)
4142
setwd(pkg_path)
4243

0 commit comments

Comments
 (0)