R/onload.R

Defines functions .onAttach .onLoad

.onLoad <- function(lib, pkg){
  if(grepl("darwin", R.Version()$platform)){
    path <- Sys.getenv("PATH")
    gpgbin <- file.path(lib, pkg, "bin")
    if(file.exists(gpgbin) && !grepl(gpgbin, path, fixed = TRUE)){
      Sys.setenv(PATH = paste(path, normalizePath(gpgbin), sep = ":"))
    }
  }
  gpg_restart(silent = TRUE)
}

.onAttach <- function(lib, pkg){
  engine <- gpg_info()
  packageStartupMessage("Found GPG ", engine$version, " (gpgme ", engine$gpgme,"). Using keyring: ", engine$home)
}

Try the gpg package in your browser

Any scripts or data that you put into this service are public.

gpg documentation built on May 31, 2023, 9:21 p.m.