brew_cleanup() removes stale lock files and outdated downloads for all formulae and casks, and removes old versions of installed formulae.

brew_cleanup(...)

Arguments

...

Arguments passed on to brew_cmd

cmd

The command to run (e.g., install)

args

Additional arguments for the command

brew_cmd

Optional: Location of brew command.

echo

Whether to print output and error messages to the screen. Defaults to TRUE for interactive sessions.