Skip to content

Fails to find realpath of directory symlink #2

Description

@cspotcode

realpath ./foo/this-is-a-symlink fails to resolve the symlink.

pwd # assume we're in /home/cspotcode
mkdir -p foo
ln -s .. ./foo/this-is-a-symlink
# ./foo/this-is-a-symlink points to .. (points to /home/cspotcode)

realpath ./foo/this-is-a-symlink # Native realpath outputs "/home/cspotcode"
realpath-bash-implementation ./foo/this-is-a-symlink # Erroneously outputs "/home/cspotcode/foo/bar"

pwd -P will resolve symlinks for everything except the last item of the path. So it doesn't resolve this-is-a-symlink.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions