Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Cross-platform readlink -f #3

Open
Potherca opened this issue Aug 4, 2015 · 1 comment
Open

Cross-platform readlink -f #3

Potherca opened this issue Aug 4, 2015 · 1 comment
Labels

Comments

@Potherca
Copy link
Collaborator

Potherca commented Aug 4, 2015

Various scripts in this repository use readlink with the -f flag to follow symlinks but this flag is not available under OSX. Using realpath could be an alternative but it does not come installed by default across systems. For OSX only, greadlink is available but platform specific calls should be avoided, also, it might not be installed and the user should not be forced to install anything (as the code from this repo should be as self-contained as possible).

The most viable alternative would be a pure shell implementation of realpath, added as a vendor script. Luckily such a thing exists.

It should be added and all offending scripts should be edited to use it.

@Potherca Potherca added the ready label Aug 4, 2015
@Potherca
Copy link
Collaborator Author

Potherca commented Jan 6, 2016

As an alternative (or for the time being) the following could also be used as a portable solution:

$( unset CDPATH && cd $( dirname $0 )/../ && pwd -P )

Further testing for portability is needed, but this seems to work quite nicely...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

1 participant