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

realpath doesn't exist on OSX #90

Closed
jakearchibald opened this issue Jul 20, 2016 · 4 comments
Closed

realpath doesn't exist on OSX #90

jakearchibald opened this issue Jul 20, 2016 · 4 comments

Comments

@jakearchibald
Copy link

But it can be installed via

brew install coreutils
@domenic
Copy link
Member

domenic commented Jul 20, 2016

Some good alternatives here... http://stackoverflow.com/q/3572030/3191

@sideshowbarker
Copy link
Contributor

Some good alternatives here... http://stackoverflow.com/q/3572030/3191

Of those http://stackoverflow.com/a/18443300/441757 looks like those most useful:

#!/bin/sh
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"
}
realpath "$@"

I’ll open a PR with a patch that uses that instead.

@sideshowbarker
Copy link
Contributor

OK I see now a complication is that the code is actually using realpath with --relative-to:

SOURCE_RELATIVE=$(realpath --relative-to=. $HTML_SOURCE

…so will also need to see if we can emulate that.

@domenic
Copy link
Member

domenic commented Dec 3, 2016

Apparently Ubuntu doesn't have --relative-to either... going to try a few fixes here.

domenic added a commit that referenced this issue Dec 3, 2016
realpath is not present by default on macOS, and on Ubuntu, it does not
support --relative-to. Instead, use a more manual method of computing
relative paths.

Closes #90.
domenic added a commit that referenced this issue Dec 5, 2016
realpath is not present by default on macOS, and on Ubuntu, it does not
support --relative-to. Instead, use a more manual method of computing
relative paths.

Closes #90.
morevnaproject added a commit to morevnaproject/synfig that referenced this issue Mar 31, 2020
morevnaproject added a commit to synfig/synfig that referenced this issue Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants