Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

test.sh doesn't work in BSD-ish (OSX) systems #1504

@ErinCall

Description

@ErinCall

In order to facilitate running as a git hook, Line 6 of test.sh says:

cd $(dirname $(readlink -f $0))

BSD readlink's -f is "format", not "canonicalize" like in GNU readlink. Tiresome. I tried patching it to this:

ABSPATH=$(readlink -f $0) || ABSPATH=$(readlink $0)
cd $(dirname "$ABSPATH")

But then invoking test.sh directly doesn't work, because BSD readlink doesn't print anything at all if its argument isn't a symlink. At that point I gave up.

BSD mktemp also diverges from GNU's version. This is a problem with the invocation on line 12. I haven't dug into it in any detail.

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