Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace realpath with realpath() #26

Open
rschoultz opened this issue Jan 6, 2022 · 2 comments
Open

Replace realpath with realpath() #26

rschoultz opened this issue Jan 6, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request MacOS

Comments

@rschoultz
Copy link

The script relies on the existence of "realpath". That does not exist in MacOS, and there does not exist a ready made package to install that holds realpath.

However, it seems as if this could be replaced by a combination of readlink/dirpath/basename, like this:

realpath() (
  OURPWD=$PWD
  cd "$(dirname "$1")"
  LINK=$(readlink "$(basename "$1")")
  while [ "$LINK" ]; do
    cd "$(dirname "$LINK")"
    LINK=$(readlink "$(basename "$1")")
  done
  REALPATH="$PWD/$(basename "$1")"
  cd "$OURPWD"
  echo "$REALPATH"
)

(from https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-os-x/18443300#18443300)

@WoozyMasta WoozyMasta added the enhancement New feature or request label Jan 11, 2022
@WoozyMasta WoozyMasta self-assigned this Jan 11, 2022
@WoozyMasta
Copy link
Owner

Another issue related to macOS #14

I don't think this is a critical issue yet, since there is a docker container. I'll try to do it when I have free time, or consider a pull request

@vitaliytv
Copy link

Also can help for mac users with this issue:

 brew install coreutils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request MacOS
Projects
None yet
Development

No branches or pull requests

3 participants