Show agent installation progress in a terminal
This commit is contained in:
@@ -4,7 +4,13 @@
|
||||
# omarchy:args=[pi|omp|opencode|claude|codex|grok|gemini|copilot|crush]
|
||||
# omarchy:examples=omarchy default agent | omarchy default agent codex | omarchy default agent claude
|
||||
|
||||
agent_file="$HOME/.local/state/omarchy/defaults/agent"
|
||||
installing=false
|
||||
if [[ ${1:-} == "--install" ]]; then
|
||||
installing=true
|
||||
shift
|
||||
fi
|
||||
|
||||
agent_file="$HOME/.config/omarchy/defaults/agent"
|
||||
|
||||
if (($# == 0)); then
|
||||
if [[ -f $agent_file ]]; then
|
||||
@@ -32,16 +38,14 @@ copilot | github-copilot) agent="copilot"; name="GitHub Copilot" ;;
|
||||
esac
|
||||
|
||||
agent_package=${agent_package:-$agent}
|
||||
installing=false
|
||||
|
||||
if ! mise where "$agent_package" &>/dev/null; then
|
||||
installing=true
|
||||
omarchy-notification-send -g "Installing $name with mise" "This might take a few minutes..."
|
||||
if [[ $installing == "false" ]] && ! mise where "$agent_package" &>/dev/null; then
|
||||
exec omarchy-launch-floating-terminal-with-presentation omarchy-default-agent --install "$agent"
|
||||
fi
|
||||
|
||||
if ! mise use -g "$agent_package"; then
|
||||
if [[ $installing == "true" ]]; then
|
||||
omarchy-notification-send -g "Could not install $name with mise"
|
||||
echo "Could not install $name with mise" >&2
|
||||
else
|
||||
omarchy-notification-send -g "Could not set $name as the default coding agent"
|
||||
fi
|
||||
@@ -51,4 +55,6 @@ fi
|
||||
mkdir -p "$(dirname "$agent_file")"
|
||||
printf '%s\n' "$agent" >"$agent_file"
|
||||
|
||||
omarchy-notification-send -g "$name is now the default coding agent"
|
||||
if [[ $installing == "false" ]]; then
|
||||
omarchy-notification-send -g "$name is now the default coding agent"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user