From fb59a3a43cd81f3da5492cb2e6f51ee77f8b6204 Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 5 Sep 2020 09:51:19 +0000 Subject: cpt: add back support for setting colors, fix shellcheck error FossilOrigin-Name: 4353efa436df913e647c5b43c709833fb76d12fb52d9db1b9bbaff04e55d0abf --- src/cpt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/cpt') diff --git a/src/cpt b/src/cpt index b3081f9..0c0f688 100755 --- a/src/cpt +++ b/src/cpt @@ -1,7 +1,6 @@ #!/bin/sh -ef -# shellcheck disable=1091 -if command -v cpt-lib >/dev/null; then . cpt-lib; else . ./cpt-lib; fi +if [ -f ./cpt-lib ]; then . ./cpt-lib; else . cpt-lib; fi # If none of the tools below are specified, we will reenable glob unset glob @@ -20,7 +19,7 @@ case "$arg" in # These are the files to be ignored. contains "lib readlink stat" "$path" && continue - printf "%b->%b %-${max}s " "${color:+\033[1;31m}" "${color:+\033[m}" "${path#*/cpt-}" + printf "%b->%b %-${max}s " "$colorb" "$colre" "${path#*/cpt-}" sed -n 's/^# *//;2p' "$(command -v "cpt-$path")" done | sort -uk1 >&2 exit -- cgit v1.2.3