Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Imports:
glue (>= 1.3.0),
jsonlite,
lifecycle (>= 1.0.0),
pak,
purrr,
rappdirs,
rlang (>= 1.1.0),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# usethis (development version)

* `create_from_github()` now installs package dependencies by default, so you're set up to immediately start working on the package. Use `install_dependencies = FALSE` to suppress (#2186).
* `use_import_from()` works in packages using `roxygen2` 8.0.0 (#2226, report by @jonthegeek; fix by @JesseAlderliesten in #2234).

* `pr_pull()`, `pr_push()` and friends now give more informative errors if usethis can't retrieve details about a remote (#1929, #2229).
Expand Down
13 changes: 11 additions & 2 deletions R/create.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ create_quarto_project <- function(
#' In the fork-and-clone case, `create_from_github()` also does additional
#' remote and branch setup, leaving you in the perfect position to make a pull
#' request with [pr_init()], one of several [functions for working with pull
#' requests][pull-requests].
#' requests][pull-requests]. Finally, it installs the dependencies of the
#' package, so you're set up to immediately start working on it.
#'
#' `create_from_github()` works best when your GitHub credentials are
#' discoverable. See below for more about authentication.
Expand Down Expand Up @@ -237,6 +238,8 @@ create_quarto_project <- function(
#' pre-existing `.Rproj` file. Defaults to `FALSE` otherwise (but note that
#' the cloned repo may already be an RStudio Project, i.e. may already have a
#' `.Rproj` file).
#' @param install_dependencies Install package dependencies? Defaults to `TRUE`,
#' so that you can immediately do development work on the package.
#' @inheritParams use_github
#'
#' @export
Expand All @@ -255,6 +258,7 @@ create_from_github <- function(
destdir = NULL,
fork = NA,
rstudio = NULL,
install_dependencies = TRUE,
open = rlang::is_interactive(),
protocol = git_protocol(),
host = NULL
Expand Down Expand Up @@ -388,7 +392,12 @@ create_from_github <- function(
)
}

rstudio <- rstudio %||% rstudio_available()
if (install_dependencies) {
ui_bullets(c("v" = "Installing missing dependencies."))
pak::local_install_dev_deps(repo_path, upgrade = FALSE)
}

rstudio <- rstudio %||% (rstudio_available() && !is_positron())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to put this down in writing: in some workflows for "make this new thing", leaving .Rproj behind is still somewhat load-bearing in terms of advertising a project root and there's no Positron equivalent. And it doesn't hurt anything.

But we don't have to fret over this here, because, by definition, if you're using create_from_github(), we're talking about a git repo and that is a strong signal of the project root. And obviously it's nicer to not have a vestigial, unnecessary .Rproj file.

rstudio <- rstudio && !is_rstudio_project()
if (rstudio) {
use_rstudio(reformat = FALSE)
Expand Down
7 changes: 6 additions & 1 deletion man/create_from_github.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading