* Quote install-app and install-font names like install-and-launch * Quote the package list too, not just the display name The display name was quoted but omarchy-pkg-add's own arguments were still interpolated into the bash -c string raw, so `omarchy install app Vim 'vim; id'` ran id. The list has to reach the helper as several words, so it cannot be quoted whole: it is split the way the unquoted expansion split it and each word is quoted on its own. Reading with -d '' keeps a newline-separated list intact instead of dropping every package after the first, which plain read -a would. install-font's package is singular and is quoted whole, and install-and-launch carried the same flaw. Reported by acrogenesis in review of #7843. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Codex XHigh <noreply@openai.com> * Test that install-font skips font-set when pkg-add fails The hostile-package case was asserting the family still got set, which only held because the mock always exits 0. pacman would reject that name and the && chain would skip font-set. * Keep the installers working when errexit is inherited read -d '' always ends at EOF rather than on its delimiter, so it reports failure on every input. Under an inherited errexit the installers exited there and built no command at all. Reported by Codex XHigh in review of #7843. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Codex XHigh <noreply@openai.com> --------- Co-authored-by: David Heinemeier Hansson <david@hey.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Codex XHigh <noreply@openai.com>
28 lines
1.1 KiB
Bash
Executable File
28 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Install a packaged app and launch it once it finishes
|
|
# omarchy:args=<display-name> <packages> <desktop-id>
|
|
# omarchy:examples=omarchy install and launch Cursor cursor-bin cursor
|
|
|
|
name="${1-}"
|
|
packages="${2-}"
|
|
desktop_id="${3-}"
|
|
|
|
if [[ -z $name || -z $packages || -z $desktop_id ]]; then
|
|
echo "Usage: omarchy-install-and-launch <display-name> <packages> <desktop-id>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
printf -v install_message '%q' "Installing ${name}..."
|
|
printf -v desktop_id_arg '%q' "$desktop_id"
|
|
|
|
# The list has to reach omarchy-pkg-add as several words, so each word is quoted
|
|
# rather than the whole string; -d '' reads past newlines and always ends at EOF.
|
|
read -r -d '' -a package_list <<<"$packages" || true
|
|
printf -v packages_arg '%q ' "${package_list[@]}"
|
|
packages_arg="${packages_arg% }"
|
|
|
|
# The subshell keeps & from backgrounding the package installation too.
|
|
exec omarchy-launch-floating-terminal-with-presentation \
|
|
"echo ${install_message}; omarchy-pkg-add ${packages_arg} && (setsid uwsm-app -- gtk-launch ${desktop_id_arg} >/dev/null 2>&1 &)"
|