Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions R/system-requirements.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ system_requirements_internal <- function(os, os_release, root, package, execute,
callback <- function(x, ...) invisible()
}

if (all(sudo, length(commands))) {
commands <- paste("sudo", commands)
}

if (execute) {
for (cmd in commands) {
if (sudo) {
cmd <- paste("sudo", cmd)
}
cli::cli_alert_info("Executing {.code {cmd}}")

processx::run("sh", c("-c", cmd), stdout_callback = callback, stderr_to_stdout = TRUE)
Expand Down