From f20a3ff9b80741fb4e1c579578ef7727ec3f810f Mon Sep 17 00:00:00 2001 From: Ethan P Date: Tue, 12 May 2020 02:36:48 -0700 Subject: [PATCH] build: Use detected system bat executable You no longer have to specify the executable as batcat on Debian or Ubuntu systems where the executable was renamed from bat. --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 08aa847..858ade5 100755 --- a/build.sh +++ b/build.sh @@ -365,7 +365,7 @@ OPT_VERIFY=true OPT_BANNER=true OPT_MINIFY="lib" OPT_PREFIX="/usr/local" -OPT_BAT="bat" +OPT_BAT="$(basename "$EXECUTABLE_BAT")" DOCS_URL="https://github.com/eth-p/bat-extras/blob/master/doc" DOCS_MAINTAINER="eth-p " @@ -389,8 +389,8 @@ while shiftopt; do done if [[ "$OPT_BAT" != "bat" ]]; then - printc_msg "%{YELLOW}Building executable scripts with an alternate bat executable at %{CLEAR}%s%{YELLOW}.%{CLEAR}\n" "$OPT_BAT" - if ! command -v "$OPT_BAT"; then + printc_msg "%{YELLOW}Building executable scripts with an alternate bat executable %{CLEAR}%s%{YELLOW}.%{CLEAR}\n" "$OPT_BAT" + if ! command -v "$OPT_BAT" &>/dev/null; then printc_err "%{YELLOW}WARNING: Bash cannot execute the specified file.\n" printc_err "%{YELLOW} The finished scripts may not run properly.%{CLEAR}\n" fi