Ensure pacman library folder exists when activating/isolating (R does not auto-create it and resorts to the first existing library location)
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
Package: Rpacman
|
Package: Rpacman
|
||||||
Type: Package
|
Type: Package
|
||||||
Title: Very simple package manager for R
|
Title: Very simple package manager for R
|
||||||
Version: 1.0.5
|
Version: 1.0.6
|
||||||
Date: 2022-05-31
|
Date: 2022-05-31
|
||||||
Authors@R: person("Craig", "Williams", email = "craig@avsdev.uk", role = c("aut", "cre"))
|
Authors@R: person("Craig", "Williams", email = "craig@avsdev.uk", role = c("aut", "cre"))
|
||||||
URL: https://avsdev.uk/R/Rpacman
|
URL: https://avsdev.uk/R/Rpacman
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
activate <- function(totalIsolation = FALSE) {
|
activate <- function(totalIsolation = FALSE) {
|
||||||
|
check_pacman_dir()
|
||||||
if (totalIsolation) {
|
if (totalIsolation) {
|
||||||
environment(.libPaths)$.lib.loc <- c(file.path(getwd(), ".pacman/library"), .Library)
|
environment(.libPaths)$.lib.loc <- c(file.path(getwd(), ".pacman/library"), .Library)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,5 +3,6 @@
|
|||||||
#'
|
#'
|
||||||
#' @export
|
#' @export
|
||||||
isolate <- function() {
|
isolate <- function() {
|
||||||
|
check_pacman_dir()
|
||||||
environment(.libPaths)$.lib.loc <- c(file.path(getwd(), ".pacman/library"), .Library)
|
environment(.libPaths)$.lib.loc <- c(file.path(getwd(), ".pacman/library"), .Library)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user