Skip to content

Commit 3f7e2c1

Browse files
committed
use system2() instead of shell()/system()
1 parent 23f5cf6 commit 3f7e2c1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

R/hooks-extra.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,14 @@ hook_png = function(
8282
if (is.null(opts) || isTRUE(opts)) opts = switch(
8383
cmd, pngquant = '--skip-if-larger', mogrify = '-trim'
8484
)
85-
if (cmd == 'pngquant') opts = paste(opts, '--ext -fs8.png')
85+
if (cmd == 'pngquant') opts = c(opts, '--ext', '-fs8.png')
8686

8787
paths = get_plot_files()
8888
paths = grep('[.]png$', paths, ignore.case = TRUE, value = TRUE)
8989

9090
in_base_dir(
9191
lapply(paths, function(x) {
92-
cmd = paste(cmd, if (is.character(options[[cmd]])) options[[cmd]], shQuote(x))
93-
(if (is_windows()) shell else system)(cmd)
92+
system2(cmd, c(opts, shQuote(x)))
9493
post_process(x)
9594
})
9695
)

0 commit comments

Comments
 (0)