From dd04093a3be0e74b243eb73b4f2832d9182cae3a Mon Sep 17 00:00:00 2001 From: Dylan Date: Mon, 1 Feb 2016 09:25:45 +1100 Subject: [PATCH] If ascii file doesn't exist fallback to distro ascii, if the distro ascii doesn't exist fallback to no image mode. --- fetch | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/fetch b/fetch index 400905fe..14973015 100755 --- a/fetch +++ b/fetch @@ -1461,6 +1461,11 @@ getascii () { ;; esac + # If the ascii file doesn't exist + # fallback to showing distro ascii. + [ ! -f "$ascii" ] && \ + ascii="distro" + if [ "$ascii" == "distro" ]; then # Lowercase the distro name ascii=${ascii_distro,,} @@ -1502,14 +1507,6 @@ getascii () { *) ascii_color="$(color $ascii_color)" ;; esac - # If the ascii file doesn't exist - # fallback to text mode. - if [ ! -f "$ascii" ]; then - padding="\033[0C" - image="off" - return - fi - print="${ascii_color}$(<"$ascii")" fi