R/get_data_check.R

Defines functions get_data_check

get_data_check <- function(tmp){
    l <- readLines(tmp)
    if(any(grepl("Bad credentials",l, ignore.case = TRUE))){
        file.remove(tmp)
        stp <- paste(
            "piggyback::pb_download() failed due to bad GitHub credentials.",
            "Please add a GitHub Personal Access Token (PAT)",
            "to your ~/.Renviron file and restart R",
            "before retrying this function.\ne.g.:\n\n",
            "   GITHUB_TOKEN=<your_PAT_here>",
            "\n\nIf you do not yet have a GitHub PAT,",
            "please follow instructions here:\n\n   ",
            paste("https://docs.github.com/en/authentication",
            "keeping-your-account-and-data-secure",
            "creating-a-personal-access-token",sep="/")
            )
        stop(stp)
    }
}
neurogenomics/MAGMA_Celltyping documentation built on Oct. 12, 2024, 12:36 a.m.