* 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>
22 lines
721 B
Bash
Executable File
22 lines
721 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Install a Nerd Font package and switch the system to it
|
|
# omarchy:args=<display-name> <package> <family>
|
|
# omarchy:examples=omarchy install font 'Cascadia Mono' ttf-cascadia-mono-nerd 'CaskaydiaMono Nerd Font'
|
|
|
|
name="${1-}"
|
|
package="${2-}"
|
|
family="${3-}"
|
|
|
|
if [[ -z $name || -z $package || -z $family ]]; then
|
|
echo "Usage: omarchy-install-font <display-name> <package> <family>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
printf -v install_message '%q' "Installing ${name}..."
|
|
printf -v package_arg '%q' "$package"
|
|
printf -v family_arg '%q' "$family"
|
|
|
|
exec omarchy-launch-floating-terminal-with-presentation \
|
|
"echo ${install_message}; omarchy-pkg-add ${package_arg} && sleep 2 && omarchy-font-set ${family_arg}"
|