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
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# devtools 1.4.1.99

* `install_github()` now removes blank lines found in a package `DESCRIPTION`
file, protecting users from the vague `error: contains a blank line` error.
(#394)

* `document()` now requires at least version 3.0.0 of roxygen2.

* `install_github()` now defaults to `dependencies = TRUE` so you definitely
Expand Down
11 changes: 8 additions & 3 deletions R/install-github.r
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,15 @@ install_github_single <- function(repo, username = getOption("github.user"),
# install_github and appends the to the description file
github_before_install <- function(bundle, pkg_path) {

# Ensure the DESCRIPTION ends with a newline
desc <- file.path(pkg_path, "DESCRIPTION")
if (!ends_with_newline(desc))
cat("\n", sep="", file = desc, append = TRUE)

# Remove any blank lines from DESCRIPTION -- this protects users from
# 'Error: contains a blank line' errors thrown by R CMD INSTALL
DESCRIPTION <- readLines(desc, warn = FALSE)
if (any(DESCRIPTION == "")) {
DESCRIPTION <- DESCRIPTION[DESCRIPTION != ""]
}
cat(DESCRIPTION, file = desc, sep = "\n")

# Function to append a field to the DESCRIPTION if it's not null
append_field <- function(name, value) {
Expand Down