completion/git: use `$OSTYPE` instead of `$(uname)`

Alsö, use `[[` instead of `[`.
pull/1911/head
John D Pell 2021-08-08 22:01:09 -04:00
parent 762c1efb5e
commit 59477c1cf8
1 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Only operate on MacOS since there are no linux paths # Only operate on MacOS since there are no linux paths
if [[ "$(uname -s)" != 'Darwin' ]] ; then if [[ "$OSTYPE" != 'darwin'* ]] ; then
_log_warning "unsupported operating system - only 'Darwin' is supported" _log_warning "unsupported operating system - only 'Darwin' is supported"
return 0 return 0
fi fi
@ -24,7 +24,7 @@ _git_bash_completion_paths=(
# Load the first completion file found # Load the first completion file found
for _comp_path in "${_git_bash_completion_paths[@]}" ; do for _comp_path in "${_git_bash_completion_paths[@]}" ; do
if [ -r "$_comp_path" ] ; then if [[ -r "$_comp_path" ]] ; then
_git_bash_completion_found=true _git_bash_completion_found=true
source "$_comp_path" source "$_comp_path"
break break