From 9572d3707329d9cff437ad46edce33db8ce7a04e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 12 Nov 2016 13:11:44 +1100 Subject: [PATCH 1/2] General: Fix more errors --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index 18014d6f..52a29a70 100755 --- a/neofetch +++ b/neofetch @@ -405,7 +405,7 @@ get_packages() { "Mac OS X") [[ -d "/usr/local/bin" ]] && \ - packages="$(($(ls -l /usr/local/bin/ | grep -v "\(../Cellar/\|brew\)" | wc -l) - 1))" + packages="$(($(ls -l /usr/local/bin/ | grep -cv "\(../Cellar/\|brew\)") - 1))" type -p port >/dev/null && \ packages="$((packages + $(port installed | wc -l) - 1))" @@ -1686,7 +1686,7 @@ get_public_ip() { fi if [[ -z "$public_ip" ]] && type -p wget >/dev/null; then - public_ip="$(wget -T 10 -qO- "$public_ip_host"; printf "%s")" + public_ip="$(wget -T 10 -qO- "$public_ip_host")" fi } From 7ac4d56286b0ed9e0759cdda70a30c6f10f5a599 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 12 Nov 2016 13:19:01 +1100 Subject: [PATCH 2/2] General: Fix more shellcheck errors --- neofetch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/neofetch b/neofetch index 52a29a70..6d7b7810 100755 --- a/neofetch +++ b/neofetch @@ -1898,7 +1898,7 @@ get_ascii() { # Calculate size of ascii file in line length / line count. line="${line//\$\{??\}}" - line="${line//'\\'/'\'}" + line="${line//\\\\/\\}" (("${#line}" > "${ascii_length:-0}")) && ascii_length="${#line}" lines="$((lines+=1))" done < "$ascii" @@ -2756,9 +2756,9 @@ dynamic_prompt() { # Set the prompt location if (("$lines" < 0)); then - printf "\033[${lines/-}A" + printf "%b" "\033[${lines/-}A" else - printf "\033[${lines}B" + printf "%b" "\033[${lines}B" fi # Add some padding @@ -2795,7 +2795,7 @@ cache_uname() { usage() { printf "%s" " NEOFETCH - USAGE: neofetch --option "value" --option "value" + USAGE: neofetch --option \"value\" --option \"value\" NOTE: There's also a config option for each flag below. @@ -3119,7 +3119,7 @@ main() { display_image # Set cursor position next to ascii art - printf "\033[$((${lines:-0} - ${prompt_loc:-0}))A" + printf "%b" "\033[$((${lines:-0} - ${prompt_loc:-0}))A" # Reset horizontal cursor position printf "\033[9999999D"