dev: automated commit - 2025-11-18 10:23:16

This commit is contained in:
Mariano Z. 2025-11-18 10:23:16 -03:00
parent ba26418a15
commit dff9e3cd97
3 changed files with 28 additions and 27 deletions

View file

@ -1,25 +1,21 @@
# Lazy load mise activation (only initialize when mise is actually called)
# This saves ~50-100ms on every shell startup
mise() {
# Initialize mise only once
if ! which mise >/dev/null 2>&1; then
# Check if mise binary exists
if [[ -f ~/.local/bin/mise ]]; then
eval "$(~/.local/bin/mise activate zsh)"
else
# Install mise if missing
echo "Installing mise..."
mkdir -p ~/.local/bin
curl -s https://mise.jdx.dev/mise-latest-linux-x64 > ~/.local/bin/mise
chmod +x ~/.local/bin/mise
~/.local/bin/mise install
eval "$(~/.local/bin/mise activate zsh)"
fi
# Set up completion after mise is initialized
compdef _mise mise 2>/dev/null
fi
command mise "$@"
}
# Activate mise during shell initialization for automatic toolchain switching
# This enables mise to automatically change toolchains when entering directories
if [[ -f ~/.local/bin/mise ]]; then
eval "$(~/.local/bin/mise activate zsh)"
elif command -v mise >/dev/null 2>&1; then
eval "$(mise activate zsh)"
else
# Install mise if missing
echo "Installing mise..."
mkdir -p ~/.local/bin
curl -s https://mise.jdx.dev/mise-latest-linux-x64 > ~/.local/bin/mise
chmod +x ~/.local/bin/mise
~/.local/bin/mise install
eval "$(~/.local/bin/mise activate zsh)"
fi
# Set up completion after mise is initialized
compdef _mise mise 2>/dev/null
#compdef mise
local curcontext="$curcontext"