Skip to content

Commit

Permalink
Update mac_machine() to include new Mac platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
ashbythorpe committed Oct 25, 2023
1 parent 4fdb9e7 commit bc68bd9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ read_pipes <- function(env, outfile, errfile, pipe = "both",
unix_spawn_tofile <- function(command, args, outfile, errfile, ...) {
tfile <- tempfile(fileext = ".sh")
write("#!/bin/sh", tfile)
write(paste(c(
shQuote(command), args, ">",
shQuote(outfile), "2>", shQuote(errfile)
), collapse = " "),
tfile,
append = TRUE
write(
paste(c(
shQuote(command), args, ">",
shQuote(outfile), "2>", shQuote(errfile)
), collapse = " "),
tfile,
append = TRUE
)
Sys.chmod(tfile)
processx::process$new(tfile, cleanup_tree = TRUE)
Expand Down Expand Up @@ -124,5 +125,5 @@ kill_process <- function(p) {

# Figure out if installing on an Intel or M1 mac
mac_machine <- function() {
ifelse(Sys.info()[["machine"]] == "arm64", "mac(64_|os-)", "mac(64|os)$")
ifelse(Sys.info()[["machine"]] == "arm64", "mac(-arm64|64_|os-)", "mac(64|os|-x64)$")
}

0 comments on commit bc68bd9

Please sign in to comment.