Pass the web app installer its icon argument so China web apps skip the wizard

This commit is contained in:
ZacharyZhang-NY committed 2026-10-06 00:37:41 -04:00
1 parent 465d4da567
commit 56c8344fd2
2 files changed
+28 -4

No files matched your search

+25 -1
View File
@@ -34,7 +34,7 @@ for (const [id, pkg] of Object.entries(aur)) {
}
for (const [id, [name, url]] of Object.entries(web)) {
const item = china.find(i => i.id === `install.china.${id}`)
if (!item || item.action !== `omarchy-launch-floating-terminal-with-presentation 'omarchy-webapp-install ${name} ${url}'` || item.disabled !== `[[ -f "$HOME/.local/share/applications/${name}.desktop" ]]`)
if (!item || item.action !== `omarchy-launch-floating-terminal-with-presentation 'omarchy-webapp-install ${name} ${url} ""'` || item.disabled !== `[[ -f "$HOME/.local/share/applications/${name}.desktop" ]]`)
fail(`${id} installs and checks the ${name} web app`)
}
console.log('ok - China Apps lists the AUR packages and web apps, shown only in China')
@@ -49,3 +49,27 @@ if [[ ${OMARCHY_TEST_NETWORK:-} == "1" ]]; then
else
skip "AUR existence check needs OMARCHY_TEST_NETWORK=1"
fi
test_tmp=$(mktemp -d)
trap 'rm -rf "$test_tmp"' EXIT
mkdir -p "$test_tmp/bin" "$test_tmp/home"
cat >"$test_tmp/bin/curl" <<'SH'
#!/bin/bash
while (($#)); do [[ $1 == "-o" ]] && out=$2; shift; done
[[ -n ${out:-} ]] && printf '\x89PNG\r\n\x1a\n\0\0\0\rIHDR\0\0\0\x01\0\0\0\x01\x08\x06\0\0\0\x1f\x15\xc4\x89' >"$out"
exit 0
SH
printf '#!/bin/bash\necho "the web app wizard opened" >&2\nexit 1\n' >"$test_tmp/bin/gum"
chmod +x "$test_tmp/bin/curl" "$test_tmp/bin/gum"
grep -o "omarchy-launch-floating-terminal-with-presentation 'omarchy-webapp-install [^']*'" "$ROOT/default/omarchy/omarchy-menu.jsonc" |
sed -e "s/^[^']*'//" -e "s/'$//" -e 's/\\"/"/g' >"$test_tmp/actions"
(($(wc -l <"$test_tmp/actions") == 3)) || fail "the menu has three China web app actions"
while read -r action; do
HOME="$test_tmp/home" PATH="$test_tmp/bin:$ROOT/bin:$PATH" bash -c "$action" >/dev/null ||
fail "the menu action installs its web app: $action"
done <"$test_tmp/actions"
for app in 腾讯文档 语雀 石墨文档; do
[[ -f $test_tmp/home/.local/share/applications/$app.desktop ]] || fail "$app gets a launcher"
done
pass "each China web app action creates its launcher without the wizard"