Only trap exit if images are enabled and fix trailing whitespace in getshell

This commit is contained in:
Dylan 2016-02-05 11:43:19 +11:00
parent 21815ecf4d
commit 0667b18138
1 changed files with 7 additions and 5 deletions

12
fetch
View File

@ -639,11 +639,12 @@ getpackages () {
getshell () { getshell () {
case "$shell_path" in case "$shell_path" in
"on") shell="$SHELL " ;; "on") shell="$SHELL" ;;
"off") shell="${SHELL##*/} " ;; "off") shell="${SHELL##*/}" ;;
esac esac
if [ "$shell_version" == "on" ]; then if [ "$shell_version" == "on" ]; then
shell+=" "
case "$shell" in case "$shell" in
*"bash"*) *"bash"*)
shell+="$(bash --version | head -n 1)" shell+="$(bash --version | head -n 1)"
@ -2163,10 +2164,11 @@ done
# Restore cursor and clear screen on ctrl+c # Restore cursor and clear screen on ctrl+c
trap 'printf "\033[?25h"; clear; exit' 2 trap 'printf "\033[?25h"; clear; exit' 2
# If the script exits for any reason, unhide the cursor.
trap 'printf "\033[?25h"' EXIT
if [ "$image" != "off" ]; then if [ "$image" != "off" ]; then
# If the script exits for any reason, unhide the cursor.
trap 'printf "\033[?25h"' EXIT
# Clear the scren
clear clear
# Hide the cursor # Hide the cursor