Shellcheck passes once again

It prefers new lines to be escaped `\\n` and to use `command -v`
instead of `which`.
trunk
Edward Loveall 6 years ago
parent d3b4967157
commit e33e510d6c
No known key found for this signature in database
GPG Key ID: 17516911DA47019A

10
mac

@ -8,7 +8,7 @@ fancy_echo() {
local fmt="$1"; shift
# shellcheck disable=SC2059
printf "\n$fmt\n" "$@"
printf "\\n$fmt\\n" "$@"
}
append_to_zshrc() {
@ -23,9 +23,9 @@ append_to_zshrc() {
if ! grep -Fqs "$text" "$zshrc"; then
if [ "$skip_new_line" -eq 1 ]; then
printf "%s\n" "$text" >> "$zshrc"
printf "%s\\n" "$text" >> "$zshrc"
else
printf "\n%s\n" "$text" >> "$zshrc"
printf "\\n%s\\n" "$text" >> "$zshrc"
fi
fi
}
@ -60,7 +60,7 @@ fi
update_shell() {
local shell_path;
shell_path="$(which zsh)"
shell_path="$(command -v zsh)"
fancy_echo "Changing your shell to zsh ..."
if ! grep "$shell_path" /etc/shells > /dev/null 2>&1 ; then
@ -72,7 +72,7 @@ update_shell() {
case "$SHELL" in
*/zsh)
if [ "$(which zsh)" != '/usr/local/bin/zsh' ] ; then
if [ "$(command -v zsh)" != '/usr/local/bin/zsh' ] ; then
update_shell
fi
;;

Loading…
Cancel
Save