Skip to content

Commit

Permalink
Added a much cleaner \.git substitution.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Coallier committed Dec 14, 2012
1 parent 2435934 commit 6a63581
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions R/install-git.r
Expand Up @@ -41,17 +41,11 @@ install_git <- function(git_url, name = NULL, subdir = NULL,
install_git_single <- function(git_url, name = NULL, subdir = NULL,
git_binary = NULL, config = list(), ...) {
if (is.null(name)) {
name <- basename(git_url)

# Following the feedback from @wch, we remove
# the "git" suffix from the name of the clone folder.
parts = unlist(strsplit(name, ".", fixed=TRUE))

if (tail(parts, n=1) == 'git') {
name = paste(head(parts, n=-1), collapse=".")
}
name <- basename(git_url)
}

name <- gsub("\\.git$", "", name)

message("Preparing installation of ", name, " using the Git-URL: ", git_url)

# Unique temporary file-name.
Expand Down

0 comments on commit 6a63581

Please sign in to comment.