only perform readlink if the directory is a symbolic link - readlink is different on osx