Files
omarchycn/bin/omarchy-mise-install
T
David Heinemeier HanssonandClaude Opus 5 1472fc1b38 Bail out of the mise stub if the install fails
Saves a second, murkier error from the exec that would follow.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-27 10:49:01 -07:00

24 lines
486 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" || exit 1
exec mise x "$package" -- "$bin" "\$@"
EOF
chmod +x "$HOME/.local/bin/$command"