mirror of
https://github.com/ggml-org/whisper.cpp.git
synced 2026-09-21 05:27:32 -05:00
fix(yt-wsp): Resolve script path without GNU realpath (#4072)
macOS ships BSD realpath, which rejects -e and is missing on older releases. Use plain realpath when present, otherwise cd and pwd -P. Fixes #530 Co-authored-by: Aurora-NICExq <Aurora-NICExq@users.noreply.github.com>
This commit is contained in:
co-authored by
Aurora-NICExq
parent
b27fbff411
commit
5670d5c0bb
+5
-1
@@ -39,7 +39,11 @@
|
||||
set -Eeuo pipefail
|
||||
|
||||
# get script file location
|
||||
SCRIPT_PATH="$(realpath -e ${BASH_SOURCE[0]})";
|
||||
if [ -x "$(command -v realpath)" ]; then
|
||||
SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
|
||||
else
|
||||
SCRIPT_PATH="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd -P)/$(basename -- "${BASH_SOURCE[0]}")"
|
||||
fi
|
||||
SCRIPT_DIR="${SCRIPT_PATH%/*}"
|
||||
|
||||
################################################################################
|
||||
|
||||
Reference in New Issue
Block a user