diff --git a/.config/lf/preview/preview b/.config/lf/preview/preview index 01cec7a25..d5dbf8e91 100755 --- a/.config/lf/preview/preview +++ b/.config/lf/preview/preview @@ -45,12 +45,15 @@ text() { run() { #shellcheck disable=SC2068 if ! command -v "$1" >/dev/null 2>&1; then - printf "%b" "${RED}Cannot execute $1${RESET}" + printf "%b" "${RED}Cannot execute ${1}${RESET}" exit 1 - elif $@; then + elif "$@"; then exit 1 else - printf "%b" "${RED}Failed to run command: $*${RESET}" + printf "%b" "${RED}Failed to run command: ${RESET}" + for l in "$@"; do + printf "%b" "\n${RED} ${l}${RESET}" + done exit 1 fi }