Skip to content

Instantly share code, notes, and snippets.

@douglascayers
Created April 12, 2023 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascayers/c1c77a69823534d31acc0f9ccabca97b to your computer and use it in GitHub Desktop.
Save douglascayers/c1c77a69823534d31acc0f9ccabca97b to your computer and use it in GitHub Desktop.
⚡️ Update various CLI tools
#!/usr/bin/env zsh
# Update Heroku CLI
# https://devcenter.heroku.com/articles/heroku-cli
echo "Updating heroku..."
heroku login
heroku update
heroku autocomplete --refresh-cache
# Update Salesforce CLI
# https://developer.salesforce.com/tools/sfdxcli
echo "Updating sfdx..."
sfdx update
sfdx autocomplete --refresh-cache
echo "Updating sf..."
sf update
sf autocomplete --refresh-cache
# Update brew
# https://brew.sh
echo "Updating brew..."
brew update
brew upgrade
brew cleanup
# Update global node modules
# https://docs.npmjs.com/cli/v8/commands/npm-update
versions=($(nvm list --no-colors | grep -E "^(->)?(\s*)(v\d+)" | sed 's/->/ /g' | awk '{ print $1 }'))
for version in "${versions[@]}"; do
echo "Updating global node modules..."
nvm use ${version}
npm update --global --no-audit --no-fund
npm list --global --depth 0
done
nvm use default
# Update yarn
# https://yarnpkg.com/getting-started/install
# echo "Updating yarn..."
# corepack enable
# yarn set version stable
# Update RVM
# https://rvm.io
echo "Updating rvm..."
rvm get stable
# Update oh-my-zsh
# https://ohmyz.sh
echo "Updating oh-my-zsh"
$ZSH/tools/upgrade.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment