tools: Make the style of conditional command more consistent

This commit is contained in:
Koichi Murase 2023-02-22 15:05:41 +09:00
parent 8b8a3b31e0
commit 46ee30ced3
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ function _omb_upgrade_check {
# Cancel upgrade if the current user doesn't have write permissions for the
# oh-my-bash directory.
[[ -w "$OSH" ]] || return 0
[[ -w $OSH ]] || return 0
# Cancel upgrade if git is unavailable on the system
type -P git &>/dev/null || return 0

View File

@ -200,7 +200,7 @@ function _omb_install_main {
fi
local RED GREEN YELLOW BLUE BOLD NORMAL
if [[ -t 1 && -n $ncolors && $ncolors -ge 8 ]]; then
if [[ -t 1 && $ncolors && $ncolors -ge 8 ]]; then
RED=$(tput setaf 1 2>/dev/null || tput AF 1 2>/dev/null)
GREEN=$(tput setaf 2 2>/dev/null || tput AF 2 2>/dev/null)
YELLOW=$(tput setaf 3 2>/dev/null || tput AF 3 2>/dev/null)
@ -278,7 +278,7 @@ function _omb_install_main {
return 1
}
# The Windows (MSYS) Git is not compatible with normal use on cygwin
if [[ $OSTYPE = cygwin ]]; then
if [[ $OSTYPE == cygwin ]]; then
if command git --version | command grep msysgit > /dev/null; then
echo "Error: Windows/MSYS Git is not supported on Cygwin"
echo "Error: Make sure the Cygwin git package is installed and is first on the path"