Fall back to OpenCode in agent launcher
This commit is contained in:
@@ -11,12 +11,6 @@ else
|
|||||||
inline=false
|
inline=false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
agent_file="$HOME/.local/state/omarchy/defaults/agent"
|
|
||||||
|
|
||||||
if [[ ! -s $agent_file ]]; then
|
|
||||||
exec omarchy-menu summon setup.default.agent
|
|
||||||
fi
|
|
||||||
|
|
||||||
agent=$(omarchy-default-agent)
|
agent=$(omarchy-default-agent)
|
||||||
|
|
||||||
if omarchy-cmd-missing "$agent"; then
|
if omarchy-cmd-missing "$agent"; then
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ launch_log="$test_tmp/launch"
|
|||||||
inline_log="$test_tmp/inline"
|
inline_log="$test_tmp/inline"
|
||||||
mise_log="$test_tmp/mise"
|
mise_log="$test_tmp/mise"
|
||||||
mise_history="$test_tmp/mise-history"
|
mise_history="$test_tmp/mise-history"
|
||||||
picker_log="$test_tmp/picker"
|
|
||||||
stub_log="$test_tmp/stubs"
|
stub_log="$test_tmp/stubs"
|
||||||
mkdir -p "$mock_bin" "$test_home"
|
mkdir -p "$mock_bin" "$test_home"
|
||||||
|
|
||||||
@@ -35,11 +34,6 @@ cat >"$mock_bin/omarchy-launch-tui" <<'SH'
|
|||||||
printf '%s\0' "$@" >"$OMARCHY_TEST_AGENT_LAUNCH_LOG"
|
printf '%s\0' "$@" >"$OMARCHY_TEST_AGENT_LAUNCH_LOG"
|
||||||
SH
|
SH
|
||||||
|
|
||||||
cat >"$mock_bin/omarchy-menu" <<'SH'
|
|
||||||
#!/bin/bash
|
|
||||||
printf '%s\0' "$@" >"$OMARCHY_TEST_AGENT_PICKER_LOG"
|
|
||||||
SH
|
|
||||||
|
|
||||||
cat >"$mock_bin/opencode" <<'SH'
|
cat >"$mock_bin/opencode" <<'SH'
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
printf '%s\0' opencode "$@" >"$OMARCHY_TEST_AGENT_INLINE_LOG"
|
printf '%s\0' opencode "$@" >"$OMARCHY_TEST_AGENT_INLINE_LOG"
|
||||||
@@ -80,7 +74,6 @@ export OMARCHY_TEST_NOTIFICATION_LOG="$notification_log"
|
|||||||
export OMARCHY_TEST_NOTIFICATION_HISTORY="$notification_history"
|
export OMARCHY_TEST_NOTIFICATION_HISTORY="$notification_history"
|
||||||
export OMARCHY_TEST_AGENT_LAUNCH_LOG="$launch_log"
|
export OMARCHY_TEST_AGENT_LAUNCH_LOG="$launch_log"
|
||||||
export OMARCHY_TEST_AGENT_INLINE_LOG="$inline_log"
|
export OMARCHY_TEST_AGENT_INLINE_LOG="$inline_log"
|
||||||
export OMARCHY_TEST_AGENT_PICKER_LOG="$picker_log"
|
|
||||||
export OMARCHY_TEST_MISE_LOG="$mise_log"
|
export OMARCHY_TEST_MISE_LOG="$mise_log"
|
||||||
export OMARCHY_TEST_MISE_HISTORY="$mise_history"
|
export OMARCHY_TEST_MISE_HISTORY="$mise_history"
|
||||||
export OMARCHY_TEST_STUB_LOG="$stub_log"
|
export OMARCHY_TEST_STUB_LOG="$stub_log"
|
||||||
@@ -144,10 +137,10 @@ pass "Remove Preinstalls deletes every optional agent lazy stub"
|
|||||||
pass "default agent falls back to OpenCode"
|
pass "default agent falls back to OpenCode"
|
||||||
|
|
||||||
omarchy-launch-agent
|
omarchy-launch-agent
|
||||||
mapfile -d '' -t picker_args <"$picker_log"
|
mapfile -d '' -t launch_args <"$launch_log"
|
||||||
[[ ${picker_args[0]} == "summon" && ${picker_args[1]} == "setup.default.agent" ]] ||
|
[[ ${#launch_args[@]} == 1 && ${launch_args[0]} == "opencode" ]] ||
|
||||||
fail "agent launcher opens the picker before a default is selected"
|
fail "agent launcher falls back to OpenCode before a default is selected"
|
||||||
pass "agent launcher opens the picker before a default is selected"
|
pass "agent launcher falls back to OpenCode before a default is selected"
|
||||||
|
|
||||||
source "$ROOT/default/bash/aliases"
|
source "$ROOT/default/bash/aliases"
|
||||||
[[ $(alias a) == "alias a='omarchy-launch-agent --inline'" ]] ||
|
[[ $(alias a) == "alias a='omarchy-launch-agent --inline'" ]] ||
|
||||||
|
|||||||
Reference in New Issue
Block a user