mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
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:
parent
8aa9daf582
commit
f3333d2292
7 changed files with 470 additions and 479 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue