From c5a556599730d1bbefbc1c36685533c7bffd6d97 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Tue, 18 Mar 2014 21:53:46 -0700 Subject: [PATCH] Fix for #394 --- R/install-github.r | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/R/install-github.r b/R/install-github.r index e7138bb85..1e0e94234 100644 --- a/R/install-github.r +++ b/R/install-github.r @@ -113,8 +113,18 @@ 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") + + # Remove any blank lines from DESCRIPTION + DESCRIPTION <- readLines(desc) + if (any(DESCRIPTION == "")) { + warning("Blank lines have been stripped from the package DESCRIPTION file ", + "to ensure a successful installation") + } + DESCRIPTION <- setdiff(DESCRIPTION, "") + cat(DESCRIPTION, file=desc, sep="\n") + + # Ensure the DESCRIPTION ends with a newline if (!ends_with_newline(desc)) cat("\n", sep="", file = desc, append = TRUE)