style: use -n flag in head and tail commands (#10391)

Co-authored-by: Marc Cornellà <hello@mcornella.com>
This commit is contained in:
Kevin Burke
2021-11-09 00:04:10 -08:00
committed by GitHub
parent 55682e3692
commit e86c6f5e7f
8 changed files with 15 additions and 15 deletions

View File

@@ -311,7 +311,7 @@ EOF
# 1. Use the most preceding one based on $PATH, then check that it's in the shells file
# 2. If that fails, get a zsh path from the shells file, then check it actually exists
if ! zsh=$(command -v zsh) || ! grep -qx "$zsh" "$shells_file"; then
if ! zsh=$(grep '^/.*/zsh$' "$shells_file" | tail -1) || [ ! -f "$zsh" ]; then
if ! zsh=$(grep '^/.*/zsh$' "$shells_file" | tail -n 1) || [ ! -f "$zsh" ]; then
fmt_error "no zsh binary found or not present in '$shells_file'"
fmt_error "change your default shell manually."
return