bahmutov / pre-git

Automatically install pre-commit / pre-push hooks in your git repo
168 stars 22 forks source link

Doesn't work in GUI apps #85

Closed pgol closed 8 years ago

pgol commented 8 years ago

env: node: No such file or directory

I guess it's related to loading different environment by GUI app that is loaded in my shell. But is there any way to fix it in this module?

bahmutov commented 8 years ago

the hooks themselves are written in Node, so they cannot work if there is no Node. Is it possible to have node in the path?

pgol commented 8 years ago

I use zsh and nvm so when I start SourceTree from finder it does't see my environment. My fix is to just open GUI app from terminal with for example:

open -a SourceTree

and then it works, I don't use GUI apps for git that often. Thank you for responding.

pulkitsinghal commented 8 years ago

Fix was as @pgol pointed out. Using nvm seems to bring it out more easily. For a few minor caveats see this.

  1. stree is the only thing you need to type if you are already in the directory of interest and sourcetree command line tools are already installed
  2. you MUST close all windows and quit sourcetree completely ... only closing the windows is not enough because that means that previous sourcetree process without the PATH is still running!