mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
* Add omarchy CLI * Remove outdated or internal * Add bash completions for command * Add omarchy command documentation * Add missing docs * Correct to what's now right * Fix tests --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
23 lines
571 B
Bash
Executable File
23 lines
571 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Install Arch packages if they are missing
|
|
# omarchy:group=install
|
|
# omarchy:name=package
|
|
# omarchy:args=<packages...>
|
|
# omarchy:examples=omarchy install package jq ripgrep
|
|
# omarchy:requires-sudo=true
|
|
|
|
if omarchy-pkg-missing "$@"; then
|
|
sudo pacman -S --noconfirm --needed "$@" || exit 1
|
|
fi
|
|
|
|
for pkg in "$@"; do
|
|
# Secondary check to handle states where pacman doesn't actually register an error
|
|
if ! pacman -Q "$pkg" &>/dev/null; then
|
|
echo -e "\033[31mError: Package '$pkg' did not install\033[0m" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
exit 0
|