From 430f5af5646a06f87cce632d6e091a75156a0ccd Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 26 Jan 2017 22:36:08 +1100 Subject: [PATCH] Ascii: Fix ascii file not working --- neofetch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index b2a76044..d3c278c0 100755 --- a/neofetch +++ b/neofetch @@ -2015,15 +2015,15 @@ image_backend() { get_ascii() { if [[ ! -f "$image_source" || - "$image_source" =~ (auto|ascii) || - "$image_source" =~ \.(png|jpg|jpe|jpeg|gif) ]]; then + "$image_source" =~ ^(auto|ascii)$ || + "$image_source" =~ \.(png|jpg|jpe|jpeg|gif)$ ]]; then # Fallback to distro ascii mode if custom ascii isn't found. - [[ ! "$image_source" =~ (auto|ascii) ]] && \ + [[ ! "$image_source" =~ (auto|ascii)$ ]] && \ err "Ascii: Ascii file not found, using distro ascii." # Fallback to distro ascii mode if source is an image. - [[ "$image_source" =~ \.(png|jpg|jpe|jpeg|gif) ]] && \ + [[ "$image_source" =~ \.(png|jpg|jpe|jpeg|gif)$ ]] && \ err "Image: Source is image file but ascii backend was selected. Using distro ascii." if [[ -d "/usr/share/neofetch/ascii/distro" ]]; then