Skip to content

Commit

Permalink
Bug correction in update_pkg()
Browse files Browse the repository at this point in the history
  • Loading branch information
phgrosjean committed Feb 8, 2021
1 parent 9b5a486 commit d67737f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: learndown
Type: Package
Version: 1.2.0
Version: 1.2.1
Title: 'SciViews' - R Markdown and Bookdown Additions for Learning Material
Description: Extension to R Markdown and Bookdown for building better learning
and e-learning material: H5P integration, course-contextual divs, different
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# learndown 1.2.1

- Bug correction: when update_pkg() encountered a more recent version of the package, it upgraded it anyway.

# learndown 1.2.0

- There are now more GitHub assignation types : `assign2()` for group assignations and `challenge()`/`challenge2()` for assignations linked to challenges (individual or in groups).
Expand Down
4 changes: 2 additions & 2 deletions R/run.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ update_pkg <- function(package, github_repos, upgrade = "never") {
if (is.null(token)) {
NULL
} else {
authenticate(token, "x-oauth-basic", "basic")
httr::authenticate(token, "x-oauth-basic", "basic")
}
}

Expand Down Expand Up @@ -244,7 +244,7 @@ update_pkg <- function(package, github_repos, upgrade = "never") {
last_rel <- sub("^[vV]([0-9]+\\.[0-9]+)\\.([0-9]+)$", "\\1-\\2", last_tag)
curr_rel <- sub("^([0-9]+\\.[0-9]+)\\.([0-9]+)$", "\\1-\\2",
packageVersion(package))
status <- try(compareVersion(last_rel, curr_rel) != 0, silent = TRUE)
status <- try(compareVersion(last_rel, curr_rel), silent = TRUE)
if (!inherits(status, "try-error")) {
if (status > 0) {
# We need to update the package
Expand Down

0 comments on commit d67737f

Please sign in to comment.