build: Add termux support

sets the OPT_PREFIX to /data/data/com.termux/files/usr if termux is detected.
This commit is contained in:
Rex Ackermann 2023-05-18 15:50:27 +06:00 committed by Ethan P
parent f47d9c4138
commit 03549d651a

View File

@ -523,6 +523,18 @@ BUILD_FILTER=()
DOCS_URL="https://github.com/eth-p/bat-extras/blob/master/doc" DOCS_URL="https://github.com/eth-p/bat-extras/blob/master/doc"
DOCS_MAINTAINER="eth-p <eth-p@hidden.email>" DOCS_MAINTAINER="eth-p <eth-p@hidden.email>"
# -----------------------------------------------------------------------------
# Use a different default prefix when running on Termux.
if [[ "$(uname -o)" = "Android" ]] && [[ -n "${TERMUX_VERSION:-}" ]]; then
OPT_PREFIX="/data/data/com.termux/files/usr/"
else
OPT_PREFIX="/usr/local"
fi
# -----------------------------------------------------------------------------
# Parse arguments.
while shiftopt; do while shiftopt; do
# shellcheck disable=SC2034 # shellcheck disable=SC2034
case "$OPT" in case "$OPT" in