-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tower Git Client compatability #18
Comments
Hey there @JamieMason. Thanks for reporting this and the detailed info! 👍 Let me know! |
The problem seems to be that Tower (and other GUIs from what I've read) use a different
Incase it helps anyone (rather than throwing it away) the following workaround of executing #!/usr/bin/env sh
# Generated by ghooks. Do not edit this file.
PATH="$PATH:/usr/local/bin"
__dirname=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__filename="${0##*/}"
ghooks_runner="
var path = require('path');
var dirname = '$__dirname';
var filename = path.resolve(dirname, '$__filename');
try {
require('ghooks')(dirname, filename);
} catch (e) {
console.warn([
'ghooks not found!',
'Make sure you have it installed in node_modules.',
'Skipping git hooks.'
].join('\n'));
}
"
node -e "$ghooks_runner" Closing as in hindsight I think this is probably really an issue for @gittower. |
Wow! :-) Sent from my iPhone
|
@JamieMason i'm a little confused.. how i can apply this workaround? do i need to modify all the hooks everytime i clone my project on a new machine? |
@bjrmatos it's something that @gtramontina (or a contributor) would need to apply to ghooks itself so that it works with these GUI apps — more work is needed though to test and finish it before it could be used. |
When you run Git from the command line, it runs in the environment as set up by your Shell. GUI OS X apps, however, have no knowledge about your shell - and the PATH environment can be changed in many different places. See Tower's online docs for more info on how to deal with this: http://git-tower.com/help/mac/faq-and-tips/faq/hook-scripts |
I have to start SourceTree from the command line to get it to load my path properly. |
For the record, the simpler way to work around this (assuming your git hooks depend on environment variables set by the shell), is to simply start Git Tower from the CLI, e.g. gittower ./any-repository This will open Git Tower client aware of the environment variables set by the shell script. |
I find it a bit odd though that Tower GUI simply cannot source |
Nice find @gajus, thanks.
|
We may actually make progress on #40. Subscribe to that issue to keep updated 👍 |
@gajus Solution magically fixed some weird behavior on OSX High Sierra. |
Hi @gtramontina,
Thanks so much for creating ghooks, our team use it every day and find it really useful.
There's one small issue though regarding support for GUI Git Clients such as Tower;
Searching for a fix, it looks like similar projects have also had this problem.
(I don't think this is environment related, but some output if needed)
I hope this is useful, thanks.
The text was updated successfully, but these errors were encountered: