Files
omarchycn/bin/omarchy-cn-app-install
T
ZacharyZhang-NYandClaude Fable 5 a317bfb36f Fix China app installs and wire the CN AI stack into Install > AI
Offline installs ship no pacman sync db, so yay resolved official
repo dependencies as AUR packages and every catalog install failed;
omarchy-cn-app-install now runs a full -Syu first (verified end to
end: WeChat builds and installs in the VM). Kimi Code gains a real
installer command reused by the harness registry, the default-agent
path, and new Install > AI entries (Kimi Code, Deep Code, AI Hub),
and the AI Hub wizard offers to launch native harnesses immediately
so their official CLI login runs, matching how Claude Code works.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QKxGW1raAWaqeU8WdHsMsp
2026-08-25 13:17:52 -04:00

52 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
# omarchy:summary=Install a China app from the catalog with source confirmation
# omarchy:args=<app-id> [--yes]
# omarchy:examples=omarchycn app install wechat | omarchycn app install tencent-docs
set -euo pipefail
APPS_JSON="$OMARCHY_PATH/cn/apps.json"
app="${1:?usage: omarchycn app install <app-id> (see: omarchycn app list)}"
yes="${2:-}"
entry=$(jq -e --arg a "$app" '.apps[$a]' "$APPS_JSON") || {
echo "Unknown app: $app (see: omarchycn app list)" >&2
exit 1
}
name=$(jq -r '.name' <<<"$entry")
source_type=$(jq -r '.source' <<<"$entry")
license=$(jq -r '.license' <<<"$entry")
if [[ $license == "proprietary" && $yes != "--yes" ]]; then
pkg=$(jq -r '.package' <<<"$entry")
echo "$name 为专有软件,来源: AUR/$pkg(构建脚本公开,二进制来自厂商)"
if [[ -t 0 ]]; then
gum confirm "确认安装?" || exit 1
else
echo "非交互环境需显式加 --yes 确认专有软件安装" >&2
exit 1
fi
fi
case "$source_type" in
aur)
# Offline installs ship no sync db; yay then treats repo deps as AUR
if ! compgen -G "/var/lib/pacman/sync/*.db" > /dev/null; then
echo "首次安装:正在同步软件仓库并更新系统(pacman -Syu)……"
sudo pacman -Syu --noconfirm
fi
omarchy-pkg-aur-add "$(jq -r '.package' <<<"$entry")"
;;
webapp)
omarchy-webapp-install "$name" "$(jq -r '.url' <<<"$entry")" "$(jq -r '.icon' <<<"$entry")"
;;
*)
echo "Unknown source type: $source_type" >&2
exit 1
;;
esac
echo "$name 安装完成"