Commit f3aba3b0 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

better shell recognition in auto-update prompt

parent 494f57b1
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -53,6 +53,13 @@ manage_path()
	eval $var="'${pre:+$pre:}$val${post:+:$post}'"
}

get_shell()
{
	if [ -n "$ZSH_NAME" ]; then echo zsh; return; fi
	if [ -n "$BASH" ]; then echo bash; return; fi
	echo sh
}

do_update()
{
	local timestamp=${HOME}/.shell/.update
@@ -66,8 +73,8 @@ do_update()

	touch "$timestamp"

	case $0 in
		*zsh) read "?$prompt" ans ;;
	case `get_shell` in
		zsh) read "?$prompt" ans ;;
		*) read -p "$prompt" ans ;;
	esac
	case "$ans" in