Use perl to resolve symlinks

This commit is contained in:
Spotlight 2022-01-27 21:48:39 -06:00
parent 10d2eb7744
commit f99966bbe6
No known key found for this signature in database
GPG key ID: 874AA355B3209BDC

View file

@ -2,7 +2,7 @@
# The least terrible way to resolve a symlink to its real path.
function realpath() {
/usr/bin/python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0";
/usr/bin/perl -e "use Cwd;print Cwd::abs_path(@ARGV[0])" "$0";
}
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"