diff options
author | Leah Rowe <leah@libreboot.org> | 2025-05-07 19:00:13 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-05-07 19:00:13 +0100 |
commit | cba04aa74b816cbd5f1266a73962f6dd48ee2892 (patch) | |
tree | 51e07a1d59a432fa9486ea05878393d43e419eb8 /include/init.sh | |
parent | a94bd3c0939fac05a902af2cce2cf862ecdf9200 (diff) |
init.sh: Use readlink in pybin()
Use realpath only as a fallback.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/init.sh')
-rw-r--r-- | include/init.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/init.sh b/include/init.sh index 1be860ea..5032d734 100644 --- a/include/init.sh +++ b/include/init.sh @@ -80,8 +80,7 @@ pybin() # ideally, don't rely on PATH or hardcoded paths if python venv. # use the *real*, direct executable linked to by the venv symlink if [ $venv -gt 0 ] && [ -L "`command -v "$1" 2>/dev/null`" ]; then - # realpath isn't posix, but available mostly universally - pypath="$(realpath \ + pypath="$(findpath \ "$(command -v "$1" 2>/dev/null)" 2>/dev/null || :)" [ -e "$pypath" ] && [ ! -d "$pypath" ] && \ [ -x "$pypath" ] && printf "%s\n" "$pypath" && return 0; : |