Add Hermes as a desktop app and a coding agent
(cherry picked from commit b71dcad96e)
(cherry picked from commit b27908369ed5fa95ca24dca2c68b895032d879d2)
40 lines
1.5 KiB
Bash
Executable File
40 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
source "$(dirname "$0")/base-test.sh"
|
|
|
|
test_tmp=$(mktemp -d)
|
|
trap 'rm -rf "$test_tmp"' EXIT
|
|
|
|
mock_bin="$test_tmp/bin"
|
|
mkdir -p "$mock_bin" "$test_tmp/home" "$test_tmp/home/.hermes/profiles/james"
|
|
|
|
for command in xdg-user-dirs-update xdg-settings xdg-mime; do
|
|
printf '#!/bin/bash\nexit 0\n' >"$mock_bin/$command"
|
|
done
|
|
chmod +x "$mock_bin"/*
|
|
|
|
# Provisioning prepends $OMARCHY_PATH/bin, which shadows a mock for anything
|
|
# Omarchy ships, so the install suite is stubbed out at its path instead. The
|
|
# real one rethemes the session it runs in: hyprctl reload against the live
|
|
# compositor, gsettings against the live desktop, and a global Node install.
|
|
mkdir -p "$test_tmp/install/user"
|
|
: >"$test_tmp/install/user/all.sh"
|
|
|
|
HOME="$test_tmp/home" PATH="$mock_bin:$ROOT/bin:$PATH" OMARCHY_PATH="$ROOT" \
|
|
OMARCHY_INSTALL="$test_tmp/install" bash "$ROOT/bin/omarchy-provision-user" >/dev/null ||
|
|
fail "omarchy-provision-user finishes"
|
|
|
|
for skill in omarchy diagnose-crash; do
|
|
link="$test_tmp/home/.hermes/skills/$skill"
|
|
[[ -L $link && $(readlink "$link") == "$ROOT/default/agents/skills/$skill" ]] ||
|
|
fail "omarchy-provision-user provisions the $skill skill for Hermes"
|
|
|
|
link="$test_tmp/home/.hermes/profiles/james/skills/$skill"
|
|
[[ -L $link && $(readlink "$link") == "$ROOT/default/agents/skills/$skill" ]] ||
|
|
fail "omarchy-provision-user provisions the $skill skill for a Hermes profile"
|
|
done
|
|
|
|
pass "omarchy-provision-user provisions Hermes skills"
|