coot icon indicating copy to clipboard operation
coot copied to clipboard

Use readlink that works for non-GNU systems too

Open blake-riley opened this issue 3 years ago • 0 comments

Homebrew works through a lot of symlinks, so the coot executable ends up a long way from coot-bin, not just one symlink away.

On most Linux distros, GNU readlink has the -f flag, is able to recursively search for the target of the symlink. macOS doesn't have GNU readlink, so it's missing the -f flag. I shamelessly yoinked some code from https://stackoverflow.com/a/246128 which manually handles the recursion.

I believe (though have no proof) that this should work on Linux --- if it does though, I'd consider it an improvement?

blake-riley avatar Apr 04 '22 04:04 blake-riley