From c44da9511cfdfa007ed6b164a3f76caf5c41424f Mon Sep 17 00:00:00 2001 From: Dylan Date: Sun, 31 Jan 2016 16:25:11 +1100 Subject: [PATCH] Don't create the directory until we know we can use image mode and remove broken underline option --- README.md | 1 - config/config | 4 ---- fetch | 14 ++++---------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 338ce612..e5d7ac29 100644 --- a/README.md +++ b/README.md @@ -231,7 +231,6 @@ alias fetch2="fetch \ --info_color num Change the color of the info Text Formatting: - --underline on/off Enable/Disable title underline --underline_char char Character to use when underlineing title --line_wrap on/off Enable/Disable line wrapping --bold on/off Enable/Disable bold text diff --git a/config/config b/config/config index 384a1236..4fe1de24 100644 --- a/config/config +++ b/config/config @@ -177,10 +177,6 @@ line_wrap="on" # --bold on/off bold="on" -# Toggle title underline -# --underline on/off -underline="on" - # Underline character # --underline_char char underline_char="-" diff --git a/fetch b/fetch index 0b35d64f..bdba42b5 100755 --- a/fetch +++ b/fetch @@ -197,10 +197,6 @@ line_wrap="on" # --bold on/off bold="on" -# Toggle title underline -# --underline on/off -underline="on" - # Underline character # --underline_char char underline_char="-" @@ -1561,9 +1557,6 @@ getimage () { image="ascii" fi - # Make the directory if it doesn't exist - mkdir -p "$imgtempdir" - # Image size is half of the terminal imgsize=$((columns * font_width / split_size)) @@ -1600,7 +1593,7 @@ getimage () { ;; esac - # If $img is empty, reset padding to 0 and exit the function + # If $img is empty, fallback to ascii mode. if [ ! -f "$img" ]; then # Fallback to ascii mode image="ascii" @@ -1612,6 +1605,9 @@ getimage () { # Lines equals terminal height lines=$(tput lines) + # Make the directory if it doesn't exist + mkdir -p "$imgtempdir" + # Check to see if the image has a file extension case "${img##*/}" in *"."*) @@ -1943,7 +1939,6 @@ usage () { cat << EOF --info_color num Change the color of the info Text Formatting: - --underline on/off Enable/Disable title underline --underline_char char Character to use when underlineing title --line_wrap on/off Enable/Disable line wrapping --bold on/off Enable/Disable bold text @@ -2046,7 +2041,6 @@ while [ "$1" ]; do --info_color) info_color=$2 ;; # Text Formatting - --underline) underline="$2" ;; --underline_char) underline_char="$2" ;; --line_wrap) line_wrap="$2" ;; --bold) bold="$2" ;;