r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
671 stars 60 forks source link

Silent install/upgrade packages #674

Closed latot closed 1 month ago

latot commented 1 month ago

Hi! I think would be great an option for silent installs/updates for pak, only print if there is an error or similar.

Thx!

gaborcsardi commented 1 month ago

Use suppressMessages():

❯ suppressMessages(pak::pkg_install("tidyverse", lib = "/tmp/lib2"))
❯ suppressMessages(pak::pkg_install("tidyverse2", lib = "/tmp/lib2"))
Error:
! error in pak subprocess
Caused by error:
! Could not solve package dependencies:
* tidyverse2: Can't find package called tidyverse2.
Type .Last.error to see the more details.
latot commented 1 month ago

Hi! @gaborcsardi I know there exists that utility, the issue is that is silence a lot of things... far from ideal.

I agree still is a simple solution.