|
|
|
@ -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
|
|
|
|
|
;;
|
|
|
|
|