Various ‘macOS’-oriented Tools and Utilities
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

28 lines
775 B

#' Check application signature/notarization information
#'
#' @param path_to_app the path to the application or comand line binary
#' @export
check_sig <- function(path_to_app) {
path_to_app <- path.expand(path_to_app[1])
stopifnot(file.exists(path_to_app))
codesign <- Sys.which("codesign")
res <- sys::exec_internal(codesign, arg = c("-dvvvv", path_to_app))
if (res$status != 0) {
stop("Error running codesign utility. Are you on macOS?", call.=FALSE)
}
out <- rawToChar(res$stderr)
out <- unlist(stringi::stri_split_lines(out))
out <- out[out != ""]
out <- stringi::stri_split_fixed(out, "=", n=2, simplify=TRUE)
out <- as.data.frame(out, stringsAsFactors=FALSE)
out <- dplyr::as_tibble(out)
colnames(out) <- c("key", "value")
out
}