Skip to content

Commit

Permalink
should not add Remotes when not there to begin with
Browse files Browse the repository at this point in the history
  • Loading branch information
muschellij2 committed Jun 15, 2017
1 parent 3f0a4db commit 5f67b03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
@@ -1,7 +1,7 @@
Package: ghtravis
Type: Package
Title: Interfaces with GitHub API and Travis
Version: 0.2.11
Version: 0.3.1
Author: John Muschelli
Maintainer: John Muschelli <muschellij2@gmail.com>
Description: Interfaces and compares things on 'GitHub'
Expand All @@ -12,3 +12,4 @@ Encoding: UTF-8
LazyData: true
RoxygenNote: 6.0.1
Suggests: covr

3 changes: 3 additions & 0 deletions R/drop_remotes.R
Expand Up @@ -21,6 +21,9 @@ drop_remotes = function(
res = rres$dcf
# nres = names(res)
remotes = get_remotes(res)
if (length(remotes) == 0) {
return(path)
}

parsed = parse_remotes(remotes)
pack_with_remote = sapply(parsed, function(x) {
Expand Down
19 changes: 11 additions & 8 deletions R/install_remote_binaries.R
Expand Up @@ -72,23 +72,26 @@ install_remote_binaries = function(
}
}
# if (!drop_all) {
# ip = installed.packages()
# need to check versions!
# ip = installed.packages()
# need to check versions!
if (is.null(remotes)) {

keep_packs = update_these_packages(path = path)
# utils::remove.packages(keep_packs)
keep = (packs %in% keep_packs)
if (!all(keep)) {
if (any(keep)) {
warning(
paste0(
"Packages: ", paste(packs[keep_packs], collapse = ","),
"have installed binary, but version not correct!")
"Packages: ", paste(packs[keep], collapse = ","),
" have installed binary, but version not correct!")
)
}
packs = packs[ !keep ]
# }
# }

if (file.exists(path) & !missing(path)) {
drop_remotes(path = path, drop_remotes = packs)
if (file.exists(path)) {
drop_remotes(path = path, drop_remotes = packs)
}
}
}
return(NULL)
Expand Down

0 comments on commit 5f67b03

Please sign in to comment.