As a software and web developer, I know the pain of upgrading CLI tools like Node, Homebrew stuff, and others individually. To simplify this process, Iāve created a simple upgrade script, āUpgrade All The Thingsā. And gave it a handy shell alias.
The Script
The script itself is just a simple shell script that runs the following commands:
Whatās going on here?
The Homebrew stuff is pretty straightforward. For Node, I use nvm
as the version manager, so I have to load it before using it. Then I install the latest version of Node (which I have pinned to a specific version) and reinstall all global packages.
I also use ncu
to check for outdated global npm packages. Finally, I disable Corepack, because it messes up my pnpm
installation from Homebrew (since Corepack does not always ship the latest version).
Shell Alias
To make it easier to run the script, Iāve created a shell alias for it. Iāve added the following line to my .zshrc
file: