0

I installed husky and set up a prehook, which works in the CLI. However, when I try to commit in the Github desktop, the "committing to..." button is loading forever. For context, .git file is located one level higher than package.json.

package.json

"scripts": {
    ...
    "prepare": "cd .. && husky install dashboard/.husky"
}

pre-commit

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

cd dashboard
npm run test

I tried adding PATH="/usr/local/bin:$PATH" to pre-commit but it doesn't seem to help.

torek
  • 448,244
  • 59
  • 642
  • 775
Jaeeun Lee
  • 3,056
  • 11
  • 40
  • 60

1 Answers1

0

I figured it out thanks to this comment here: https://github.com/desktop/desktop/issues/2518#issuecomment-323872966

Basically, my hook was running npm run test, and the test had --watch option so it never exited. Removing the command fixed the issue.

Jaeeun Lee
  • 3,056
  • 11
  • 40
  • 60