#!/bin/bash # Upgrade the languages you installed with mise (configure languages), within # the versions you chose: ruby@latest moves to the newest Ruby, java@21 stays 21. # mise itself comes from pacman, which updates it. is_installed() { command -v mise > /dev/null && [ -n "$(mise ls --global --quiet 2> /dev/null)" ] } run_update() { # Answer yes to any mise prompt (e.g. trusting config files) export MISE_YES=1 # From home, so a project's mise.toml in the current directory doesn't count cd "$HOME" || return 1 echo "Updating languages installed with mise..." mise upgrade || return 1 # A new Ruby gets Rails from ~/.default-gems; this updates it between Rubies if mise exec -- gem list -i rails &> /dev/null; then echo "Updating Rails..." mise exec -- gem update rails bundler || return 1 fi }