fix(posix-shell): fix on checking command exist

Use `command -v $CMD >/dev/null 2>&1` to check if command exist
This commit is contained in:
js0ny 2025-02-23 20:31:13 +00:00
parent 8aa9daf582
commit f3333d2292
7 changed files with 470 additions and 479 deletions

View file

@ -14,29 +14,29 @@ done
# Update package managers #
# Homebrew, macOS
if command -v brew > /dev/null; then
if command -v brew >/dev/null 2>&1; then
brew update
brew upgrade
fi
# Arch
if command -v pacman > /dev/null; then
if command -v pacman >/dev/null 2>&1; then
sudo pacman -Syu
fi
# Debian
if command -v apt > /dev/null; then
if command -v apt >/dev/null 2>&1; then
sudo apt update
sudo apt upgrade
fi
# Fedora
if command -v dnf > /dev/null; then
if command -v dnf >/dev/null 2>&1; then
sudo dnf update
fi
# WSL
if command -v winget.exe > /dev/null; then
if command -v winget.exe >/dev/null 2>&1; then
winget.exe upgrade
fi