Closed stweil closed 4 years ago
Thanks for pointing this out.
realpath
is used here to resolve relative to absolute paths in a reliable way. On GNU systems it is included in coreutils in recent years.
What do you propose to use instead, readlink
perhaps? IIUC this is not reliable either, having an incompatible CLI between BSDs and GNUs. (Cf https://unix.stackexchange.com/questions/136494/whats-the-difference-between-realpath-and-readlink-f)
BTW in the meantime, you can use make
directly, provided you stick to the direct installation method.
$(realpath "$PWD")
might not need realpath
, so could be replaced by $PWD
.
And $(realpath $(dirname "$0"))
always has a directory argument, so $(cd $(dirname "$0") && pwd)
could work.
Other people suggest to use Python: python3 -c "import os; print(os.path.realpath('$1'))"
.
Ok, I also let go of symlink canonicalization and used your suggestions @stweil. Fingers crossed!
The default command line on macOS does not provide
realpath
which is used inocrd-make
, so an error message is shown: