Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Relative symlinks don't work #92

@yaychris

Description

@yaychris

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions