R/utils.R

slug_to_id <- function(slug, ...) {
    if (inherits(slug, "travis_repo")) {
        slug[["id"]]
    } else if (is.numeric(slug)) {
        slug
    } else if (is.character(slug)) {
        get_repo(slug, ...)[["id"]]
    } else {
        stop("Cannot coerce value to repo id")
    }
}
cloudyr/travisci documentation built on May 13, 2019, 8:22 p.m.