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

Relative symlinks don't work #92

Open
yaychris opened this issue Nov 21, 2016 · 0 comments
Open

Relative symlinks don't work #92

yaychris opened this issue Nov 21, 2016 · 0 comments

Comments

@yaychris
Copy link
Member

yaychris commented Nov 21, 2016

On 0.1.6, Sprig would correctly load a seed file that's a symlink to a relative path (e.g. ln -s ../shared/animals.yml animals.yml).

0.2.0 no longer works:

Errno::ENOENT: No such file or directory @ rb_sysopen - ../shared/animals.yml

This commit appears to be the culprit. readlink only reads the filename of the symlink reference, which in this case, is ../shared/animals.yml. It's passed to File.open, which tries to open the filename relative to the current working directory, which doesn't work.

realpath should be used because it interprets the symlink relative to the directory of the symlink. PR forthcoming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant