aboutsummaryrefslogtreecommitdiff
path: root/src/cpt
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-09-05 09:51:19 +0000
committermerakor <cem@ckyln.com>2020-09-05 09:51:19 +0000
commitfb59a3a43cd81f3da5492cb2e6f51ee77f8b6204 (patch)
tree101408a67b6e4c1d32b0da5dce27a7d26cff0c97 /src/cpt
parent5416e51a84066536701d503163512c2f5616d23b (diff)
downloadcpt-fb59a3a43cd81f3da5492cb2e6f51ee77f8b6204.tar.gz
cpt: add back support for setting colors, fix shellcheck error
FossilOrigin-Name: 4353efa436df913e647c5b43c709833fb76d12fb52d9db1b9bbaff04e55d0abf
Diffstat (limited to 'src/cpt')
-rwxr-xr-xsrc/cpt5
1 files changed, 2 insertions, 3 deletions
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