Files
omarchycn/bin/omarchy-mise-install
T
husamemadH 4480a14236 Fix infinite loop in omarchy-mise-install wrappers
exec via `mise exec "$package"` so the tool resolves from mise's
install dir instead of by name through PATH. Previously `exec "$bin"`
could re-find the wrapper itself when ~/.local/bin precedes mise's
install path (e.g. when starship/zoxide clobber mise's PROMPT_COMMAND
hook, #3685), recursing forever. Scoping to $package keeps lazy install
and avoids leaking other runtimes into PATH.
2026-07-23 11:26:32 +03:00

24 lines
479 B
Bash
Executable File

#!/bin/bash
# omarchy:summary=Install a small mise-backed wrapper for a given tool.
# omarchy:args=<package> [command-name [bin-name]]
if [[ -z $1 ]]; then
echo "Usage: omarchy-mise-install <package> [command-name [bin-name]]"
exit 1
fi
package=$1
command=${2:-$1}
bin=${3:-$command}
mkdir -p "$HOME/.local/bin"
cat >"$HOME/.local/bin/$command" <<EOF
#!/bin/bash
mise use -g "$package"
exec mise exec "$package" -- "$bin" "\$@"
EOF
chmod +x "$HOME/.local/bin/$command"