From 46b24323d0a335e30e6298897315bae2668eb4cd Mon Sep 17 00:00:00 2001 From: David Boon Date: Wed, 25 Jun 2025 10:22:01 -0700 Subject: [PATCH] fix: use realpath instead of python use realpath, always available, instead of python time python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" service.yaml /Users/davidboon/Projects/outreach/devbase/evadnoob_fix_get-absolute-path-remove-python-dependency/service.yaml python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" service.yaml 0.01s user 0.02s system 7% cpu 0.436 total time realpath service.yaml /Users/davidboon/Projects/outreach/devbase/evadnoob_fix_get-absolute-path-remove-python-dependency/service.yaml realpath service.yaml 0.00s user 0.00s system 15% cpu 0.013 total the exec to python to noticibly slower than using realpath from coreutils --- scripts/devbase.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/devbase.sh b/scripts/devbase.sh index f8df6d49e..5e91239e5 100755 --- a/scripts/devbase.sh +++ b/scripts/devbase.sh @@ -10,8 +10,7 @@ gojqVersion="v0.12.17" # get_absolute_path returns the absolute path of a file get_absolute_path() { - python="$(command -v python3 || command -v python)" - "$python" -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$1" + realpath "$1" } # gojq returns the path to a JIT-downloaded gojq binary.