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

Closed

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.

Activity

  1. jsha commented on Apr 21, 2015

    @jsha
    Member

    Bummer. The goal in supporting symlinks was that we could auto-install push hooks when people run install-dev-dependencies, but update the test script. I suppose we could do the same by putting a small script in .git/hooks that cd's to the repo root and then runs ./test.sh.

    If you can provide a universal mktemp invocation, or a simple detection test, I'd be happy to update that bit as well.

  2. ErinCall commented on Apr 21, 2015

    @ErinCall
    ContributorAuthor

    I'll see what I can do! I'm visiting my due-to-give-birth-any-minute sister this week, so don't think I've abandoned this if nothing happens for a bit :)

  3. ErinCall commented on May 16, 2015

    @ErinCall
    ContributorAuthor

    After ages of thinking "oh yeah I need to get around to that," I've gotten around to this! #1714 fixes up test.sh and a couple other scripts so they run on my machine. If someone would be so kind as to check it on a linux OS I'd appreciate it. I do have an Ubuntu VPS where I could test the fix but I'm not sure if it presents a realistic dev environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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