Skip to content

Commit

Permalink
make pkg creation failure more understandable in case of unavailable …
Browse files Browse the repository at this point in the history
…name
  • Loading branch information
maelle committed Nov 7, 2018
1 parent 31cc552 commit a071f94
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/createPackageProject.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ createPackageProject <- function(name, folder = getwd(),
bestPractices = TRUE,
coverage = "codecov",
private = TRUE) {
tryCatch({
if (is_available(name)) {
if (is_available(name)) {
tryCatch({

dir.create(file.path(folder, name))
usethis::proj_set(file.path(folder, name),
force = TRUE)
Expand Down Expand Up @@ -62,7 +63,7 @@ createPackageProject <- function(name, folder = getwd(),
usethis::use_git()
#use_github(private = private)
}
}

}
,
error = function(e) {
Expand All @@ -72,6 +73,6 @@ createPackageProject <- function(name, folder = getwd(),
message(sprintf("Oops! An error was found and the `%s` directory was deleted", name))
}
)

}
invisible(TRUE)
}

0 comments on commit a071f94

Please sign in to comment.