Skip to content

Commit 2f1625a

Browse files
authored
Merge pull request #145 from karchjd/master
Do not open project on error
2 parents 226b846 + 7d61ee8 commit 2f1625a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

R/rstan_create_package.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,16 @@ rstan_create_package <- function(path,
140140
call. = FALSE)
141141
rstudio <- rstudio && rstudioapi::isAvailable()
142142
}
143+
144+
if (file.exists(path)) {
145+
stop("Directory '", path, "' already exists.", call. = FALSE)
146+
}
147+
143148
if (open && rstudio) {
144149
on.exit(rstudioapi::openProject(file.path(DIR, name), newSession = TRUE))
145150
}
146151

147152
# run usethis::create_package()
148-
if (file.exists(path)) {
149-
stop("Directory '", path, "' already exists.", call. = FALSE)
150-
}
151153
message("Creating package skeleton for package: ", name, domain = NA)
152154
suppressMessages(
153155
usethis::create_package(

man/rstantools-package.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)